Skip to content

Commit 29ca04a

Browse files
johnniwintherCommit Queue
authored andcommitted
[cfe][InternalNodes] Move type arguments to TypeArguments
This adds a TypeArguments class to the internal ast nodes and moves the type arguments ArgumentsImpl to this class. Change-Id: I86ebff7197ffc641c5083941316c54c728b56c66 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467580 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
1 parent 3f5427d commit 29ca04a

File tree

49 files changed

+1164
-780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1164
-780
lines changed

pkg/front_end/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ linter:
2424
- unrelated_type_equality_checks
2525
- annotate_overrides
2626
- always_declare_return_types
27+
- deprecated_member_use_from_same_package
2728
# - always_specify_types

pkg/front_end/lib/src/fragment/constructor/encoding.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,8 +802,10 @@ class _ExtensionTypeInitializerToStatementConverter
802802
new ExpressionStatement(
803803
new VariableSet(
804804
thisVariable,
805-
new StaticInvocation(node.target, node.arguments.toArguments())
806-
..fileOffset = node.fileOffset,
805+
new StaticInvocation(
806+
node.target,
807+
node.arguments.toArguments(node.inferredTypeArguments),
808+
)..fileOffset = node.fileOffset,
807809
)..fileOffset = node.fileOffset,
808810
)..fileOffset = node.fileOffset,
809811
);

pkg/front_end/lib/src/fragment/enum_element.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,16 +325,17 @@ class EnumElementDeclaration
325325
new IntLiteral(elementIndex),
326326
new StringLiteral(constant),
327327
];
328-
List<DartType>? typeArguments;
328+
TypeArguments? typeArguments;
329329
List<TypeBuilder>? typeArgumentBuilders =
330330
_fragment.constructorReferenceBuilder?.typeArguments;
331331
if (typeArgumentBuilders != null) {
332-
typeArguments = <DartType>[];
332+
List<DartType> types = [];
333333
for (TypeBuilder typeBuilder in typeArgumentBuilders) {
334-
typeArguments.add(
334+
types.add(
335335
typeBuilder.build(libraryBuilder, TypeUse.constructorTypeArgument),
336336
);
337337
}
338+
typeArguments = new TypeArguments(types);
338339
}
339340
if (result != null && result.isInvalidLookup) {
340341
assert(

0 commit comments

Comments
 (0)