Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit df8ad69

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Store staticInvokeType and typeArgumentTypes.
We set them during linking, so for consistency and to keep the same expectations for linking and loaded elements tests, we need to store and read them. Change-Id: I8de88e2dbf4e08eee2d654b27f7cb548ffb7f1be Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202161 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com>
1 parent 09b75a3 commit df8ad69

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed

pkg/analyzer/lib/src/dart/analysis/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import 'package:meta/meta.dart';
8181
/// TODO(scheglov) Clean up the list of implicitly analyzed files.
8282
class AnalysisDriver implements AnalysisDriverGeneric {
8383
/// The version of data format, should be incremented on every format change.
84-
static const int DATA_VERSION = 141;
84+
static const int DATA_VERSION = 143;
8585

8686
/// The length of the list returned by [_computeDeclaredVariablesSignature].
8787
static const int _declaredVariablesSignatureLength = 4;

pkg/analyzer/lib/src/summary2/ast_binary_reader.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ class AstBinaryReader {
575575
typeArguments,
576576
arguments,
577577
);
578-
_readExpressionResolution(node);
578+
_readInvocationExpression(node);
579579
return node;
580580
}
581581

@@ -748,8 +748,8 @@ class AstBinaryReader {
748748
}
749749

750750
void _readInvocationExpression(InvocationExpressionImpl node) {
751-
// TODO(scheglov) typeArgumentTypes and staticInvokeType?
752-
node.typeArgumentTypes = [];
751+
node.staticInvokeType = _reader.readType();
752+
node.typeArgumentTypes = _reader.readOptionalTypeList();
753753
_readExpressionResolution(node);
754754
}
755755

pkg/analyzer/lib/src/summary2/ast_binary_writer.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,8 +790,9 @@ class AstBinaryWriter extends ThrowingAstVisitor<void> {
790790
void _storeInvocationExpression(InvocationExpression node) {
791791
_writeOptionalNode(node.typeArguments);
792792
_writeNode(node.argumentList);
793+
_sink.writeType(node.staticInvokeType);
794+
_sink.writeOptionalTypeList(node.typeArgumentTypes);
793795
_storeExpression(node);
794-
// TODO(scheglov) typeArgumentTypes and staticInvokeType?
795796
}
796797

797798
void _storeNormalFormalParameter(

pkg/analyzer/lib/src/summary2/bundle_reader.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,12 @@ class ResolutionReader {
13431343
throw UnimplementedError('memberFlags: $memberFlags');
13441344
}
13451345

1346+
List<DartType>? readOptionalTypeList() {
1347+
if (_reader.readBool()) {
1348+
return _readTypeList();
1349+
}
1350+
}
1351+
13461352
DartType readRequiredType() {
13471353
return readType()!;
13481354
}

pkg/analyzer/lib/src/summary2/bundle_writer.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,15 @@ class ResolutionSink extends _SummaryDataWriter {
547547
}
548548
}
549549

550+
void writeOptionalTypeList(List<DartType>? types) {
551+
if (types != null) {
552+
writeBool(true);
553+
_writeTypeList(types);
554+
} else {
555+
writeBool(false);
556+
}
557+
}
558+
550559
void writeType(DartType? type) {
551560
if (type == null) {
552561
writeByte(Tag.NullType);

pkg/analyzer/test/src/summary/resynthesize_common.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,7 +3012,7 @@ const int a;
30123012
staticType: int Function()
30133013
token: abs
30143014
operator: ..
3015-
staticInvokeType: null
3015+
staticInvokeType: int Function()
30163016
staticType: int
30173017
staticType: int
30183018
target: IntegerLiteral
@@ -3908,8 +3908,10 @@ const int b;
39083908
staticElement: self::@function::f
39093909
staticType: T Function<T>(T)
39103910
token: f
3911-
staticInvokeType: null
3911+
staticInvokeType: int Function(int)
39123912
staticType: int
3913+
typeArgumentTypes
3914+
int
39133915
typeArguments: TypeArgumentList
39143916
arguments
39153917
TypeName

0 commit comments

Comments
 (0)