@@ -2614,14 +2614,13 @@ class BodyBuilder extends StackListenerImpl
26142614 // Delay adding [typeArguments] to [forest] for type aliases: They
26152615 // must be unaliased to the type arguments of the denoted type.
26162616 bool isInForest =
2617- arguments is Arguments &&
2617+ arguments is ArgumentsImpl &&
26182618 typeArguments != null &&
26192619 (receiver is ! TypeUseGenerator ||
26202620 receiver.declaration is ! TypeAliasBuilder );
26212621 if (isInForest) {
2622- assert (forest.argumentsTypeArguments (arguments).isEmpty);
2623- forest.argumentsSetTypeArguments (
2624- arguments,
2622+ assert (arguments.types.isEmpty);
2623+ arguments.setExplicitTypeArguments (
26252624 buildDartTypeArguments (
26262625 typeArguments,
26272626 TypeUse .invocationTypeArgument,
@@ -2648,7 +2647,7 @@ class BodyBuilder extends StackListenerImpl
26482647 beginToken,
26492648 name,
26502649 typeArguments,
2651- arguments as Arguments ,
2650+ arguments as ArgumentsImpl ,
26522651 isTypeArgumentsInForest: isInForest,
26532652 ),
26542653 );
@@ -7226,7 +7225,7 @@ class BodyBuilder extends StackListenerImpl
72267225
72277226 Expression buildConstructorInvocation (
72287227 Member target,
7229- Arguments arguments, {
7228+ ArgumentsImpl arguments, {
72307229 Constness constness = Constness .implicit,
72317230 TypeAliasBuilder ? typeAliasBuilder,
72327231 int fileOffset = - 1 ,
@@ -7314,7 +7313,7 @@ class BodyBuilder extends StackListenerImpl
73147313 typeEnvironment: typeEnvironment,
73157314 fileUri: uri,
73167315 fileOffset: fileOffset,
7317- inferred: ! hasExplicitTypeArguments ( arguments) ,
7316+ inferred: ! arguments.hasExplicitTypeArguments ,
73187317 );
73197318 node = factoryConstructorInvocation;
73207319 } else {
@@ -7381,7 +7380,7 @@ class BodyBuilder extends StackListenerImpl
73817380 .withArgumentsOld (positionalParameterCount, positionalArgumentsCount)
73827381 .withLocation (uri, arguments.fileOffset, noLength);
73837382 }
7384- List <NamedExpression > named = forest. argumentsNamed ( arguments) ;
7383+ List <NamedExpression > named = arguments.named ;
73857384 if (named.isNotEmpty) {
73867385 Set <String ?> parameterNames = new Set .of (
73877386 function.namedParameters.map ((a) => a.name),
@@ -7433,28 +7432,24 @@ class BodyBuilder extends StackListenerImpl
74337432 int requiredPositionalParameterCountToReport =
74347433 function.requiredParameterCount;
74357434 int positionalParameterCountToReport = function.positionalParameters.length;
7436- int positionalArgumentCountToReport = forest
7437- .argumentsPositional (arguments)
7438- .length;
7439- if (forest.argumentsPositional (arguments).length <
7440- function.requiredParameterCount) {
7435+ int positionalArgumentCountToReport = arguments.positional.length;
7436+ if (arguments.positional.length < function.requiredParameterCount) {
74417437 return cfe.codeTooFewArguments
74427438 .withArgumentsOld (
74437439 requiredPositionalParameterCountToReport,
74447440 positionalArgumentCountToReport,
74457441 )
74467442 .withLocation (uri, arguments.fileOffset, noLength);
74477443 }
7448- if (forest.argumentsPositional (arguments).length >
7449- function.positionalParameters.length) {
7444+ if (arguments.positional.length > function.positionalParameters.length) {
74507445 return cfe.codeTooManyArguments
74517446 .withArgumentsOld (
74527447 positionalParameterCountToReport,
74537448 positionalArgumentCountToReport,
74547449 )
74557450 .withLocation (uri, arguments.fileOffset, noLength);
74567451 }
7457- List <NamedExpression > named = forest. argumentsNamed ( arguments) ;
7452+ List <NamedExpression > named = arguments.named ;
74587453 if (named.isNotEmpty) {
74597454 Set <String > names = new Set .of (
74607455 function.namedParameters.map ((a) => a.name),
@@ -7479,7 +7474,7 @@ class BodyBuilder extends StackListenerImpl
74797474 }
74807475 }
74817476 }
7482- List <Object > types = forest. argumentsTypeArguments ( arguments) ;
7477+ List <Object > types = arguments.types ;
74837478 List <StructuralParameter > typeParameters = function.typeParameters;
74847479 if (typeParameters.length != types.length && types.length != 0 ) {
74857480 // A wrong (non-zero) amount of type arguments given. That's an error.
@@ -7589,7 +7584,7 @@ class BodyBuilder extends StackListenerImpl
75897584
75907585 ConstantContext savedConstantContext = pop () as ConstantContext ;
75917586
7592- if (arguments is ! Arguments ) {
7587+ if (arguments is ! ArgumentsImpl ) {
75937588 push (new ParserErrorGenerator (this , nameToken, cfe.codeSyntheticToken));
75947589 arguments = forest.createArguments (offset, []);
75957590 } else if (type is Generator ) {
@@ -7647,7 +7642,7 @@ class BodyBuilder extends StackListenerImpl
76477642 List <TypeBuilder >? typeArguments,
76487643 String className,
76497644 String constructorName,
7650- Arguments arguments, {
7645+ ArgumentsImpl arguments, {
76517646 required int instantiationOffset,
76527647 required int invocationOffset,
76537648 required bool inImplicitCreationContext,
@@ -7686,9 +7681,8 @@ class BodyBuilder extends StackListenerImpl
76867681 );
76877682 } else {
76887683 if (typeArguments != null ) {
7689- assert (forest.argumentsTypeArguments (arguments).isEmpty);
7690- forest.argumentsSetTypeArguments (
7691- arguments,
7684+ assert (arguments.types.isEmpty);
7685+ arguments.setExplicitTypeArguments (
76927686 buildDartTypeArguments (
76937687 typeArguments,
76947688 TypeUse .constructorTypeArgument,
@@ -7721,7 +7715,7 @@ class BodyBuilder extends StackListenerImpl
77217715 TypeDeclarationBuilder ? typeDeclarationBuilder,
77227716 Token nameToken,
77237717 Token nameLastToken,
7724- Arguments arguments,
7718+ ArgumentsImpl arguments,
77257719 String name,
77267720 List <TypeBuilder >? typeArguments,
77277721 int charOffset,
@@ -7937,8 +7931,8 @@ class BodyBuilder extends StackListenerImpl
79377931 ),
79387932 );
79397933 }
7940- assert (forest. argumentsTypeArguments ( arguments) .isEmpty);
7941- forest. argumentsSetTypeArguments (arguments, dartTypeArguments);
7934+ assert (arguments.types .isEmpty);
7935+ arguments. setExplicitTypeArguments ( dartTypeArguments);
79427936 case TypeAliasBuilder ():
79437937 // Coverage-ignore(suite): Not run.
79447938 case NominalParameterBuilder ():
@@ -8029,8 +8023,8 @@ class BodyBuilder extends StackListenerImpl
80298023 ),
80308024 );
80318025 }
8032- assert (forest. argumentsTypeArguments ( arguments) .isEmpty);
8033- forest. argumentsSetTypeArguments (arguments, dartTypeArguments);
8026+ assert (arguments.types .isEmpty);
8027+ arguments. setExplicitTypeArguments ( dartTypeArguments);
80348028 } else {
80358029 LibraryBuilder libraryBuilder;
80368030 List <NominalParameterBuilder >? typeParameters;
@@ -8045,10 +8039,10 @@ class BodyBuilder extends StackListenerImpl
80458039 typeParameters = typeDeclarationBuilder.typeParameters;
80468040 }
80478041 if (typeParameters == null || typeParameters.isEmpty) {
8048- assert (forest. argumentsTypeArguments ( arguments) .isEmpty);
8049- forest. argumentsSetTypeArguments (arguments, []);
8042+ assert (arguments.types .isEmpty);
8043+ arguments. setExplicitTypeArguments ( []);
80508044 } else {
8051- if (forest. argumentsTypeArguments ( arguments) .isEmpty) {
8045+ if (arguments.types .isEmpty) {
80528046 // No type arguments provided to unaliased class, use defaults.
80538047 List <DartType > result = new List <DartType >.generate (
80548048 typeParameters.length,
@@ -8058,7 +8052,7 @@ class BodyBuilder extends StackListenerImpl
80588052 ),
80598053 growable: true ,
80608054 );
8061- forest. argumentsSetTypeArguments (arguments, result);
8055+ arguments. setExplicitTypeArguments ( result);
80628056 }
80638057 }
80648058 }
@@ -8073,9 +8067,8 @@ class BodyBuilder extends StackListenerImpl
80738067 }
80748068 } else {
80758069 if (typeArguments != null && ! isTypeArgumentsInForest) {
8076- assert (forest.argumentsTypeArguments (arguments).isEmpty);
8077- forest.argumentsSetTypeArguments (
8078- arguments,
8070+ assert (arguments.types.isEmpty);
8071+ arguments.setExplicitTypeArguments (
80798072 buildDartTypeArguments (
80808073 typeArguments,
80818074 TypeUse .constructorTypeArgument,
@@ -11111,7 +11104,7 @@ class BodyBuilder extends StackListenerImpl
1111111104 @override
1111211105 Initializer buildRedirectingInitializer (
1111311106 Name name,
11114- Arguments arguments, {
11107+ ArgumentsImpl arguments, {
1111511108 required int fileOffset,
1111611109 }) {
1111711110 Builder ? constructorBuilder = _context.lookupConstructor (name);
@@ -11361,14 +11354,14 @@ class BodyBuilder extends StackListenerImpl
1136111354
1136211355 @override
1136311356 Expression evaluateArgumentsBefore (
11364- Arguments ? arguments,
11357+ ArgumentsImpl ? arguments,
1136511358 Expression expression,
1136611359 ) {
1136711360 if (arguments == null ) return expression;
1136811361 List <Expression > expressions = new List <Expression >.of (
11369- forest. argumentsPositional ( arguments) ,
11362+ arguments.positional ,
1137011363 );
11371- for (NamedExpression named in forest. argumentsNamed ( arguments) ) {
11364+ for (NamedExpression named in arguments.named ) {
1137211365 // Coverage-ignore-block(suite): Not run.
1137311366 expressions.add (named.value);
1137411367 }
@@ -11392,7 +11385,7 @@ class BodyBuilder extends StackListenerImpl
1139211385 Expression buildMethodInvocation (
1139311386 Expression receiver,
1139411387 Name name,
11395- Arguments arguments,
11388+ ArgumentsImpl arguments,
1139611389 int offset, {
1139711390 bool isConstantExpression = false ,
1139811391 bool isNullAware = false ,
@@ -11418,7 +11411,7 @@ class BodyBuilder extends StackListenerImpl
1141811411 @override
1141911412 Expression buildSuperInvocation (
1142011413 Name name,
11421- Arguments arguments,
11414+ ArgumentsImpl arguments,
1142211415 int offset, {
1142311416 bool isConstantExpression = false ,
1142411417 bool isNullAware = false ,
0 commit comments