[cfe] Allow named arguments anywhere by the CFE Change-Id: I36ecafe821fe328bd27cb40dafca78ad0bf5dd81 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214803 Commit-Queue: Chloe Stefantsova <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/lib/src/api_prototype/compiler_options.dart b/pkg/front_end/lib/src/api_prototype/compiler_options.dart index 370f581..7f14df8 100644 --- a/pkg/front_end/lib/src/api_prototype/compiler_options.dart +++ b/pkg/front_end/lib/src/api_prototype/compiler_options.dart
@@ -126,6 +126,8 @@ Map<ExperimentalFlag, Version>? experimentEnabledVersionForTesting; Map<ExperimentalFlag, Version>? experimentReleasedVersionForTesting; + bool enableUnscheduledExperiments = false; + /// Environment map used when evaluating `bool.fromEnvironment`, /// `int.fromEnvironment` and `String.fromEnvironment` during constant /// evaluation. If the map is `null`, all environment constants will be left @@ -357,6 +359,9 @@ if (currentSdkVersion != other.currentSdkVersion) return false; if (emitDeps != other.emitDeps) return false; if (!equalSets(invocationModes, other.invocationModes)) return false; + if (enableUnscheduledExperiments != other.enableUnscheduledExperiments) { + return false; + } return true; }
diff --git a/pkg/front_end/lib/src/base/command_line_options.dart b/pkg/front_end/lib/src/base/command_line_options.dart index 46aabec..a8c7e9b 100644 --- a/pkg/front_end/lib/src/base/command_line_options.dart +++ b/pkg/front_end/lib/src/base/command_line_options.dart
@@ -29,6 +29,8 @@ static const String compileSdk = "--compile-sdk"; static const String dumpIr = "--dump-ir"; static const String enableExperiment = "--enable-experiment"; + static const String enableUnscheduledExperiments = + "--enable-unscheduled-experiments"; static const String excludeSource = "--exclude-source"; static const String omitPlatform = "--omit-platform"; static const String fatal = "--fatal"; @@ -59,6 +61,8 @@ const Option(Flags.dumpIr, const BoolValue(false)); static const Option<List<String>?> enableExperiment = const Option(Flags.enableExperiment, const StringListValue()); + static const Option<bool> enableUnscheduledExperiments = + const Option(Flags.enableUnscheduledExperiments, const BoolValue(false)); static const Option<bool> excludeSource = const Option(Flags.excludeSource, const BoolValue(false)); static const Option<bool> omitPlatform =
diff --git a/pkg/front_end/lib/src/base/processed_options.dart b/pkg/front_end/lib/src/base/processed_options.dart index e6a3ec0..8601e94 100644 --- a/pkg/front_end/lib/src/base/processed_options.dart +++ b/pkg/front_end/lib/src/base/processed_options.dart
@@ -186,6 +186,8 @@ bool get warnOnReachabilityCheck => _raw.warnOnReachabilityCheck; + bool get enableUnscheduledExperiments => _raw.enableUnscheduledExperiments; + /// The entry-points provided to the compiler. final List<Uri> inputs;
diff --git a/pkg/front_end/lib/src/fasta/builder/factory_builder.dart b/pkg/front_end/lib/src/fasta/builder/factory_builder.dart index d19bcde..2561223 100644 --- a/pkg/front_end/lib/src/fasta/builder/factory_builder.dart +++ b/pkg/front_end/lib/src/fasta/builder/factory_builder.dart
@@ -401,7 +401,7 @@ unhandled("${targetBuilder.runtimeType}", "buildOutlineExpressions", charOffset, fileUri); } - Arguments targetInvocationArguments; + ArgumentsImpl targetInvocationArguments; { List<Expression> positionalArguments = <Expression>[]; for (VariableDeclaration parameter
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart index 3bf60515..15ba274 100644 --- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart +++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -451,6 +451,11 @@ return libraryBuilder.enableConstructorTearOffsInLibrary; } + @override + bool get enableNamedArgumentsAnywhereInLibrary { + return libraryBuilder.enableNamedArgumentsAnywhereInLibrary; + } + void _enterLocalState({bool inLateLocalInitializer: false}) { _localInitializerState = _localInitializerState.prepend(inLateLocalInitializer); @@ -1700,35 +1705,72 @@ push(new ParserRecovery(beginToken.charOffset)); return; } + List<Object?>? argumentsOriginalOrder; + if (libraryBuilder.enableNamedArgumentsAnywhereInLibrary) { + argumentsOriginalOrder = new List<Object?>.from(arguments); + } int firstNamedArgumentIndex = arguments.length; + int positionalCount = 0; + bool hasNamedBeforePositional = false; for (int i = 0; i < arguments.length; i++) { Object? node = arguments[i]; if (node is NamedExpression) { firstNamedArgumentIndex = i < firstNamedArgumentIndex ? i : firstNamedArgumentIndex; } else { + positionalCount++; Expression argument = toValue(node); arguments[i] = argument; + argumentsOriginalOrder?[i] = argument; if (i > firstNamedArgumentIndex) { - arguments[i] = new NamedExpression( - "#$i", - buildProblem(fasta.messageExpectedNamedArgument, - argument.fileOffset, noLength)) - ..fileOffset = beginToken.charOffset; + hasNamedBeforePositional = true; + if (!libraryBuilder.enableNamedArgumentsAnywhereInLibrary) { + arguments[i] = new NamedExpression( + "#$i", + buildProblem(fasta.messageExpectedNamedArgument, + argument.fileOffset, noLength)) + ..fileOffset = beginToken.charOffset; + } } } } + if (!hasNamedBeforePositional) { + argumentsOriginalOrder = null; + } if (firstNamedArgumentIndex < arguments.length) { - List<Expression> positional = new List<Expression>.from( - arguments.getRange(0, firstNamedArgumentIndex)); - List<NamedExpression> named = new List<NamedExpression>.from( - arguments.getRange(firstNamedArgumentIndex, arguments.length)); - push(forest.createArguments(beginToken.offset, positional, named: named)); + List<Expression> positional; + List<NamedExpression> named; + if (libraryBuilder.enableNamedArgumentsAnywhereInLibrary) { + positional = + new List<Expression>.filled(positionalCount, dummyExpression); + named = new List<NamedExpression>.filled( + arguments.length - positionalCount, dummyNamedExpression); + int positionalIndex = 0; + int namedIndex = 0; + for (int i = 0; i < arguments.length; i++) { + if (arguments[i] is NamedExpression) { + named[namedIndex++] = arguments[i] as NamedExpression; + } else { + positional[positionalIndex++] = arguments[i] as Expression; + } + } + assert( + positionalIndex == positional.length && namedIndex == named.length); + } else { + positional = new List<Expression>.from( + arguments.getRange(0, firstNamedArgumentIndex)); + named = new List<NamedExpression>.from( + arguments.getRange(firstNamedArgumentIndex, arguments.length)); + } + + push(forest.createArguments(beginToken.offset, positional, + named: named, argumentsOriginalOrder: argumentsOriginalOrder)); } else { // TODO(kmillikin): Find a way to avoid allocating a second list in the // case where there were no named arguments, which is a common one. push(forest.createArguments( - beginToken.offset, new List<Expression>.from(arguments))); + beginToken.offset, new List<Expression>.from(arguments), + argumentsOriginalOrder: argumentsOriginalOrder)); } assert(checkState(beginToken, [ValueKinds.Arguments])); } @@ -1831,7 +1873,7 @@ } else if (arguments == null) { push(receiver); } else { - push(finishSend(receiver, typeArguments, arguments as Arguments, + push(finishSend(receiver, typeArguments, arguments as ArgumentsImpl, beginToken.charOffset, isTypeArgumentsInForest: isInForest)); } @@ -1847,8 +1889,11 @@ } @override - Expression_Generator_Initializer finishSend(Object receiver, - List<UnresolvedType>? typeArguments, Arguments arguments, int charOffset, + Expression_Generator_Initializer finishSend( + Object receiver, + List<UnresolvedType>? typeArguments, + ArgumentsImpl arguments, + int charOffset, {bool isTypeArgumentsInForest = false}) { if (receiver is Generator) { return receiver.doInvocation(charOffset, typeArguments, arguments,
diff --git a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart index 04979e2..cd04351 100644 --- a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart +++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
@@ -217,7 +217,7 @@ /// If the invocation has explicit type arguments /// [buildTypeWithResolvedArguments] called instead. Expression_Generator_Initializer doInvocation( - int offset, List<UnresolvedType>? typeArguments, Arguments arguments, + int offset, List<UnresolvedType>? typeArguments, ArgumentsImpl arguments, {bool isTypeArgumentsInForest = false}); Expression_Generator buildSelectorAccess( @@ -1774,7 +1774,7 @@ @override Expression doInvocation( - int offset, List<UnresolvedType>? typeArguments, Arguments arguments, + int offset, List<UnresolvedType>? typeArguments, ArgumentsImpl arguments, {bool isTypeArgumentsInForest = false}) { if (invokeTarget != null) { return _helper.buildExtensionMethodInvocation( @@ -1789,7 +1789,8 @@ extensionTypeArguments: _createExtensionTypeArguments(), typeArguments: arguments.types, positionalArguments: arguments.positional, - namedArguments: arguments.named), + namedArguments: arguments.named, + argumentsOriginalOrder: arguments.argumentsOriginalOrder), isTearOff: false); } else { return _helper.forest.createExpressionInvocation( @@ -2649,8 +2650,8 @@ Generator generator = _createInstanceAccess(send.token, send.name, isNullAware: isNullAware); if (send.arguments != null) { - return generator.doInvocation( - offsetForToken(send.token), send.typeArguments, send.arguments!, + return generator.doInvocation(offsetForToken(send.token), + send.typeArguments, send.arguments! as ArgumentsImpl, isTypeArgumentsInForest: send.isTypeArgumentsInForest); } else { return generator; @@ -2676,7 +2677,7 @@ @override Expression_Generator_Initializer doInvocation( - int offset, List<UnresolvedType>? typeArguments, Arguments arguments, + int offset, List<UnresolvedType>? typeArguments, ArgumentsImpl arguments, {bool isTypeArgumentsInForest = false}) { Generator generator = _createInstanceAccess(token, callName); return generator.doInvocation(offset, typeArguments, arguments, @@ -2935,7 +2936,7 @@ @override Expression_Generator_Initializer doInvocation( - int offset, List<UnresolvedType>? typeArguments, Arguments arguments, + int offset, List<UnresolvedType>? typeArguments, ArgumentsImpl arguments, {bool isTypeArgumentsInForest = false}) { Object suffix = suffixGenerator.doInvocation( offset, typeArguments, arguments, @@ -3126,7 +3127,7 @@ Selector send, int operatorOffset, bool isNullAware) { int nameOffset = offsetForToken(send.token); Name name = send.name; - Arguments? arguments = send.arguments; + ArgumentsImpl? arguments = send.arguments as ArgumentsImpl?; TypeDeclarationBuilder? declarationBuilder = declaration; TypeAliasBuilder? aliasBuilder; @@ -4067,8 +4068,8 @@ "'${send.name.text}' != ${send.token.lexeme}"); Object result = qualifiedLookup(send.token); if (send is InvocationSelector) { - result = _helper.finishSend( - result, send.typeArguments, send.arguments, send.fileOffset, + result = _helper.finishSend(result, send.typeArguments, + send.arguments as ArgumentsImpl, send.fileOffset, isTypeArgumentsInForest: send.isTypeArgumentsInForest); } if (isNullAware) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart b/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart index 96e8b7f..9f355e5 100644 --- a/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart +++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart
@@ -54,12 +54,14 @@ bool get enableConstructorTearOffsInLibrary; + bool get enableNamedArgumentsAnywhereInLibrary; + Expression_Generator_Builder scopeLookup( Scope scope, String name, Token token, {bool isQualified: false, PrefixBuilder? prefix}); Expression_Generator_Initializer finishSend(Object receiver, - List<UnresolvedType>? typeArguments, Arguments arguments, int offset, + List<UnresolvedType>? typeArguments, ArgumentsImpl arguments, int offset, {bool isTypeArgumentsInForest = false}); Initializer buildInvalidInitializer(Expression expression,
diff --git a/pkg/front_end/lib/src/fasta/kernel/forest.dart b/pkg/front_end/lib/src/fasta/kernel/forest.dart index 4cc99a7..8e7b3b9 100644 --- a/pkg/front_end/lib/src/fasta/kernel/forest.dart +++ b/pkg/front_end/lib/src/fasta/kernel/forest.dart
@@ -27,19 +27,25 @@ class Forest { const Forest(); - Arguments createArguments(int fileOffset, List<Expression> positional, + ArgumentsImpl createArguments(int fileOffset, List<Expression> positional, {List<DartType>? types, List<NamedExpression>? named, - bool hasExplicitTypeArguments = true}) { + bool hasExplicitTypeArguments = true, + List<Object?>? argumentsOriginalOrder}) { // ignore: unnecessary_null_comparison assert(fileOffset != null); if (!hasExplicitTypeArguments) { - ArgumentsImpl arguments = - new ArgumentsImpl(positional, types: <DartType>[], named: named); + ArgumentsImpl arguments = new ArgumentsImpl(positional, + types: <DartType>[], + named: named, + argumentsOriginalOrder: argumentsOriginalOrder); arguments.types.addAll(types!); return arguments; } else { - return new ArgumentsImpl(positional, types: types, named: named) + return new ArgumentsImpl(positional, + types: types, + named: named, + argumentsOriginalOrder: argumentsOriginalOrder) ..fileOffset = fileOffset; } } @@ -53,7 +59,8 @@ int? extensionTypeArgumentOffset, List<DartType> typeArguments = const <DartType>[], List<Expression> positionalArguments = const <Expression>[], - List<NamedExpression> namedArguments = const <NamedExpression>[]}) { + List<NamedExpression> namedArguments = const <NamedExpression>[], + List<Object?>? argumentsOriginalOrder}) { // ignore: unnecessary_null_comparison assert(fileOffset != null); return new ArgumentsImpl.forExtensionMethod( @@ -62,11 +69,12 @@ extensionTypeArgumentOffset: extensionTypeArgumentOffset, typeArguments: typeArguments, positionalArguments: positionalArguments, - namedArguments: namedArguments) + namedArguments: namedArguments, + argumentsOriginalOrder: argumentsOriginalOrder) ..fileOffset = fileOffset; } - Arguments createArgumentsEmpty(int fileOffset) { + ArgumentsImpl createArgumentsEmpty(int fileOffset) { // ignore: unnecessary_null_comparison assert(fileOffset != null); return createArguments(fileOffset, <Expression>[]);
diff --git a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart index 9956d82..ac7b321 100644 --- a/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart +++ b/pkg/front_end/lib/src/fasta/kernel/inference_visitor.dart
@@ -640,8 +640,8 @@ bool hadExplicitTypeArguments = hasExplicitTypeArguments(node.arguments); FunctionType functionType = node.target.function .computeThisFunctionType(inferrer.library.nonNullable); - InvocationInferenceResult result = inferrer.inferInvocation( - typeContext, node.fileOffset, functionType, node.arguments, + InvocationInferenceResult result = inferrer.inferInvocation(typeContext, + node.fileOffset, functionType, node.arguments as ArgumentsImpl, isConst: node.isConst, staticTarget: node.target); if (!inferrer.isTopLevel) { SourceLibraryBuilder library = inferrer.library; @@ -670,8 +670,8 @@ : new FunctionType( [], const DynamicType(), inferrer.library.nonNullable); TypeArgumentsInfo typeArgumentsInfo = getTypeArgumentsInfo(node.arguments); - InvocationInferenceResult result = inferrer.inferInvocation( - typeContext, node.fileOffset, calleeType, node.arguments, + InvocationInferenceResult result = inferrer.inferInvocation(typeContext, + node.fileOffset, calleeType, node.arguments as ArgumentsImpl, staticTarget: node.target); StaticInvocation replacement = new StaticInvocation(node.target, node.arguments); @@ -932,8 +932,8 @@ FunctionType functionType = node.target.function .computeThisFunctionType(inferrer.library.nonNullable); - InvocationInferenceResult result = inferrer.inferInvocation( - typeContext, node.fileOffset, functionType, node.arguments, + InvocationInferenceResult result = inferrer.inferInvocation(typeContext, + node.fileOffset, functionType, node.arguments as ArgumentsImpl, isConst: node.isConst, staticTarget: node.target); node.hasBeenInferred = true; Expression resultNode = node; @@ -963,8 +963,8 @@ .computeAliasedConstructorFunctionType( typedef, inferrer.library.library); calleeType = replaceReturnType(calleeType, calleeType.returnType.unalias); - InvocationInferenceResult result = inferrer.inferInvocation( - typeContext, node.fileOffset, calleeType, node.arguments, + InvocationInferenceResult result = inferrer.inferInvocation(typeContext, + node.fileOffset, calleeType, node.arguments as ArgumentsImpl, isConst: node.isConst, staticTarget: node.target); node.hasBeenInferred = true; Expression resultNode = node; @@ -987,8 +987,8 @@ FunctionType calleeType = node.target.function .computeAliasedFactoryFunctionType(typedef, inferrer.library.library); calleeType = replaceReturnType(calleeType, calleeType.returnType.unalias); - InvocationInferenceResult result = inferrer.inferInvocation( - typeContext, node.fileOffset, calleeType, node.arguments, + InvocationInferenceResult result = inferrer.inferInvocation(typeContext, + node.fileOffset, calleeType, node.arguments as ArgumentsImpl, isConst: node.isConst, staticTarget: node.target); node.hasBeenInferred = true; Expression resultNode = node; @@ -2827,9 +2827,16 @@ Link<NullAwareGuard> nullAwareGuards = result.nullAwareGuards; Expression receiver = result.nullAwareAction; DartType receiverType = result.nullAwareActionType; - return inferrer.inferMethodInvocation(node.fileOffset, nullAwareGuards, - receiver, receiverType, node.name, node.arguments, typeContext, - isExpressionInvocation: false, isImplicitCall: false); + return inferrer.inferMethodInvocation( + node.fileOffset, + nullAwareGuards, + receiver, + receiverType, + node.name, + node.arguments as ArgumentsImpl, + typeContext, + isExpressionInvocation: false, + isImplicitCall: false); } ExpressionInferenceResult visitExpressionInvocation( @@ -2839,9 +2846,16 @@ Link<NullAwareGuard> nullAwareGuards = result.nullAwareGuards; Expression receiver = result.nullAwareAction; DartType receiverType = result.nullAwareActionType; - return inferrer.inferMethodInvocation(node.fileOffset, nullAwareGuards, - receiver, receiverType, callName, node.arguments, typeContext, - isExpressionInvocation: true, isImplicitCall: true); + return inferrer.inferMethodInvocation( + node.fileOffset, + nullAwareGuards, + receiver, + receiverType, + callName, + node.arguments as ArgumentsImpl, + typeContext, + isExpressionInvocation: true, + isImplicitCall: true); } ExpressionInferenceResult visitNamedFunctionExpressionJudgment( @@ -5798,8 +5812,8 @@ .computeThisFunctionType(inferrer.library.nonNullable), inferrer.coreTypes.thisInterfaceType( node.target.enclosingClass, inferrer.library.nonNullable)); - inferrer.inferInvocation( - const UnknownType(), node.fileOffset, functionType, node.arguments, + inferrer.inferInvocation(const UnknownType(), node.fileOffset, functionType, + node.arguments as ArgumentsImpl, skipTypeArgumentInference: true, staticTarget: node.target); ArgumentsImpl.removeNonInferrableArgumentTypes( node.arguments as ArgumentsImpl); @@ -5974,8 +5988,8 @@ : new FunctionType( [], const DynamicType(), inferrer.library.nonNullable); TypeArgumentsInfo typeArgumentsInfo = getTypeArgumentsInfo(node.arguments); - InvocationInferenceResult result = inferrer.inferInvocation( - typeContext, node.fileOffset, calleeType, node.arguments, + InvocationInferenceResult result = inferrer.inferInvocation(typeContext, + node.fileOffset, calleeType, node.arguments as ArgumentsImpl, staticTarget: node.target); // ignore: unnecessary_null_comparison if (!inferrer.isTopLevel && node.target != null) { @@ -6022,8 +6036,8 @@ .computeThisFunctionType(inferrer.library.nonNullable) .withoutTypeParameters) as FunctionType, inferrer.thisType!); - inferrer.inferInvocation( - const UnknownType(), node.fileOffset, functionType, node.arguments, + inferrer.inferInvocation(const UnknownType(), node.fileOffset, functionType, + node.arguments as ArgumentsImpl, skipTypeArgumentInference: true, staticTarget: node.target); } @@ -6770,8 +6784,8 @@ if (node.arguments != null) { FunctionType calleeType = new FunctionType([], inferredType, inferrer.library.nonNullable); - inferrer.inferInvocation( - typeContext, node.fileOffset, calleeType, node.arguments!); + inferrer.inferInvocation(typeContext, node.fileOffset, calleeType, + node.arguments! as ArgumentsImpl); } return new ExpressionInferenceResult(inferredType, node); }
diff --git a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart index b587d91..7560883 100644 --- a/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart +++ b/pkg/front_end/lib/src/fasta/kernel/internal_ast.dart
@@ -491,6 +491,8 @@ int _explicitTypeArgumentCount; + List<Object?>? argumentsOriginalOrder; + ArgumentsImpl.internal( {required List<Expression> positional, required List<DartType>? types, @@ -504,10 +506,13 @@ explicitExtensionTypeArgumentCount, this._extensionTypeArgumentOffset = extensionTypeArgumentOffset, this._explicitTypeArgumentCount = explicitTypeArgumentCount, + this.argumentsOriginalOrder = null, super(positional, types: types, named: named); ArgumentsImpl(List<Expression> positional, - {List<DartType>? types, List<NamedExpression>? named}) + {List<DartType>? types, + List<NamedExpression>? named, + this.argumentsOriginalOrder}) : _explicitTypeArgumentCount = types?.length ?? 0, _extensionTypeParameterCount = 0, _explicitExtensionTypeArgumentCount = 0, @@ -521,7 +526,8 @@ int? extensionTypeArgumentOffset, List<DartType> typeArguments = const <DartType>[], List<Expression> positionalArguments = const <Expression>[], - List<NamedExpression> namedArguments = const <NamedExpression>[]}) + List<NamedExpression> namedArguments = const <NamedExpression>[], + this.argumentsOriginalOrder}) : _extensionTypeParameterCount = extensionTypeParameterCount, _explicitExtensionTypeArgumentCount = extensionTypeArguments.length, _explicitTypeArgumentCount = typeArguments.length,
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart index dbecaaa..9c6d6bb 100644 --- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart +++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -318,6 +318,7 @@ bool? _enableGenericMetadataInLibrary; bool? _enableExtensionTypesInLibrary; bool? _enableConstructorTearOffsInLibrary; + bool? _enableNamedArgumentsAnywhereInLibrary; bool get enableConstFunctionsInLibrary => _enableConstFunctionsInLibrary ??= loader.target.isExperimentEnabledInLibraryByVersion( @@ -392,6 +393,10 @@ .getExperimentEnabledVersionInLibrary( ExperimentalFlag.extensionTypes, _packageUri ?? importUri); + bool get enableNamedArgumentsAnywhereInLibrary => + _enableNamedArgumentsAnywhereInLibrary ??= + loader.enableUnscheduledExperiments; + void _updateLibraryNNBDSettings() { library.isNonNullableByDefault = isNonNullableByDefault; switch (loader.nnbdMode) {
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart index 9e34d6d..29e57b3 100644 --- a/pkg/front_end/lib/src/fasta/source/source_loader.dart +++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -503,6 +503,9 @@ NnbdMode get nnbdMode => target.context.options.nnbdMode; + bool get enableUnscheduledExperiments => + target.context.options.enableUnscheduledExperiments; + CoreTypes get coreTypes { assert(_coreTypes != null, "CoreTypes has not been computed."); return _coreTypes!;
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart index cf74dd7..888eeaf 100644 --- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart +++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -2085,7 +2085,7 @@ } InvocationInferenceResult inferInvocation(DartType typeContext, int offset, - FunctionType calleeType, Arguments arguments, + FunctionType calleeType, ArgumentsImpl arguments, {List<VariableDeclaration>? hoistedExpressions, bool isSpecialCasedBinaryOperator: false, bool isSpecialCasedTernaryOperator: false, @@ -2143,7 +2143,7 @@ typeParameters: calleeType.typeParameters .take(extensionTypeParameterCount) .toList()); - Arguments extensionArguments = engine.forest.createArguments( + ArgumentsImpl extensionArguments = engine.forest.createArguments( arguments.fileOffset, [arguments.positional.first], types: getExplicitExtensionTypeArguments(arguments)); _inferInvocation(const UnknownType(), offset, extensionFunctionType, @@ -2171,7 +2171,7 @@ typeParameters: targetTypeParameters); targetFunctionType = extensionSubstitution .substituteType(targetFunctionType) as FunctionType; - Arguments targetArguments = engine.forest.createArguments( + ArgumentsImpl targetArguments = engine.forest.createArguments( arguments.fileOffset, arguments.positional.skip(1).toList(), named: arguments.named, types: getExplicitTypeArguments(arguments)); InvocationInferenceResult result = _inferInvocation(typeContext, offset, @@ -2201,7 +2201,7 @@ DartType typeContext, int offset, FunctionType calleeType, - Arguments arguments, + ArgumentsImpl arguments, List<VariableDeclaration>? hoistedExpressions, {bool isSpecialCasedBinaryOperator: false, bool isSpecialCasedTernaryOperator: false, @@ -2215,6 +2215,7 @@ // [receiverType] must be provided for special-cased operators. assert(!isSpecialCasedBinaryOperator && !isSpecialCasedTernaryOperator || receiverType != null); + List<TypeParameter> calleeTypeParameters = calleeType.typeParameters; if (calleeTypeParameters.isNotEmpty) { // It's possible that one of the callee type parameters might match a type @@ -2230,11 +2231,14 @@ calleeType = fresh.applyToFunctionType(calleeType); calleeTypeParameters = fresh.freshTypeParameters; } + List<DartType>? explicitTypeArguments = getExplicitTypeArguments(arguments); + bool inferenceNeeded = !skipTypeArgumentInference && explicitTypeArguments == null && calleeTypeParameters.isNotEmpty; bool typeChecksNeeded = !isTopLevel; + List<DartType>? inferredTypes; Substitution? substitution; List<DartType>? formalTypes; @@ -2243,6 +2247,15 @@ formalTypes = []; actualTypes = []; } + + List<VariableDeclaration>? localHoistedExpressions; + if (library.enableNamedArgumentsAnywhereInLibrary && + arguments.argumentsOriginalOrder != null && + hoistedExpressions == null && + !isTopLevel) { + hoistedExpressions = localHoistedExpressions = <VariableDeclaration>[]; + } + if (inferenceNeeded) { // ignore: unnecessary_null_comparison if (isConst && typeContext != null) { @@ -2281,60 +2294,166 @@ staticTarget == typeSchemaEnvironment.coreTypes.identicalProcedure; // TODO(paulberry): if we are doing top level inference and type arguments // were omitted, report an error. - for (int position = 0; position < arguments.positional.length; position++) { - DartType formalType = getPositionalParameterType(calleeType, position); - DartType inferredFormalType = substitution != null - ? substitution.substituteType(formalType) - : formalType; - DartType inferredType; - if (isImplicitExtensionMember && position == 0) { - assert( - receiverType != null, - "No receiver type provided for implicit extension member " - "invocation."); - continue; + List<Object?> argumentsEvaluationOrder; + if (library.enableNamedArgumentsAnywhereInLibrary && + arguments.argumentsOriginalOrder != null) { + if (staticTarget?.isExtensionMember ?? false) { + // Add the receiver. + argumentsEvaluationOrder = <Object?>[ + arguments.positional[0], + ...arguments.argumentsOriginalOrder! + ]; } else { - if (isSpecialCasedBinaryOperator) { - inferredFormalType = - typeSchemaEnvironment.getContextTypeOfSpecialCasedBinaryOperator( - typeContext, receiverType!, inferredFormalType, - isNonNullableByDefault: isNonNullableByDefault); - } else if (isSpecialCasedTernaryOperator) { - inferredFormalType = - typeSchemaEnvironment.getContextTypeOfSpecialCasedTernaryOperator( - typeContext, receiverType!, inferredFormalType, - isNonNullableByDefault: isNonNullableByDefault); + argumentsEvaluationOrder = arguments.argumentsOriginalOrder!; + } + } else { + argumentsEvaluationOrder = <Object?>[ + ...arguments.positional, + ...arguments.named + ]; + } + arguments.argumentsOriginalOrder = null; + + // The following loop determines how many argument expressions should be + // hoisted to preserve the evaluation order. The computation is based on the + // following observation: the largest suffix of the argument vector, such + // that every positional argument in that suffix comes before any named + // argument, retains the evaluation order after the rest of the arguments + // are hoisted, and therefore doesn't need to be hoisted itself. The loop + // below finds the starting position of such suffix and stores it in the + // [hoistingEndIndex] variable. In case all positional arguments come + // before all named arguments, the suffix coincides with the entire argument + // vector, and none of the arguments is hoisted. That way the legacy + // behavior is preserved. + int hoistingEndIndex; + if (library.enableNamedArgumentsAnywhereInLibrary) { + hoistingEndIndex = argumentsEvaluationOrder.length - 1; + for (int i = argumentsEvaluationOrder.length - 2; + i >= 0 && hoistingEndIndex == i + 1; + i--) { + int previousWeight = + argumentsEvaluationOrder[i + 1] is NamedExpression ? 1 : 0; + int currentWeight = + argumentsEvaluationOrder[i] is NamedExpression ? 1 : 0; + if (currentWeight <= previousWeight) { + --hoistingEndIndex; } + } + } else { + hoistingEndIndex = 0; + } + + int positionalIndex = 0; + int namedIndex = 0; + for (int evaluationOrderIndex = 0; + evaluationOrderIndex < argumentsEvaluationOrder.length; + evaluationOrderIndex++) { + Object? argument = argumentsEvaluationOrder[evaluationOrderIndex]; + assert( + argument is Expression || argument is NamedExpression, + "Expected the argument to be either an Expression " + "or a NamedExpression, got '${argument.runtimeType}'."); + if (argument is Expression) { + int index = positionalIndex++; + DartType formalType = getPositionalParameterType(calleeType, index); + DartType inferredFormalType = substitution != null + ? substitution.substituteType(formalType) + : formalType; + DartType inferredType; + if (isImplicitExtensionMember && index == 0) { + assert( + receiverType != null, + "No receiver type provided for implicit extension member " + "invocation."); + continue; + } else { + if (isSpecialCasedBinaryOperator) { + inferredFormalType = typeSchemaEnvironment + .getContextTypeOfSpecialCasedBinaryOperator( + typeContext, receiverType!, inferredFormalType, + isNonNullableByDefault: isNonNullableByDefault); + } else if (isSpecialCasedTernaryOperator) { + inferredFormalType = typeSchemaEnvironment + .getContextTypeOfSpecialCasedTernaryOperator( + typeContext, receiverType!, inferredFormalType, + isNonNullableByDefault: isNonNullableByDefault); + } + ExpressionInferenceResult result = inferExpression( + arguments.positional[index], + isNonNullableByDefault + ? inferredFormalType + : legacyErasure(inferredFormalType), + inferenceNeeded || + isSpecialCasedBinaryOperator || + isSpecialCasedTernaryOperator || + typeChecksNeeded); + inferredType = identical(result.inferredType, noInferredType) || + isNonNullableByDefault + ? result.inferredType + : legacyErasure(result.inferredType); + if (localHoistedExpressions != null && + evaluationOrderIndex >= hoistingEndIndex) { + hoistedExpressions = null; + } + Expression expression = + _hoist(result.expression, inferredType, hoistedExpressions); + if (isIdentical && arguments.positional.length == 2) { + if (index == 0) { + flowAnalysis.equalityOp_rightBegin(expression, inferredType); + } else { + flowAnalysis.equalityOp_end( + arguments.parent as Expression, expression, inferredType); + } + } + arguments.positional[index] = expression..parent = arguments; + } + if (inferenceNeeded || typeChecksNeeded) { + formalTypes!.add(formalType); + actualTypes!.add(inferredType); + } + } else { + assert(argument is NamedExpression); + int index = namedIndex++; + NamedExpression namedArgument = arguments.named[index]; + DartType formalType = + getNamedParameterType(calleeType, namedArgument.name); + DartType inferredFormalType = substitution != null + ? substitution.substituteType(formalType) + : formalType; ExpressionInferenceResult result = inferExpression( - arguments.positional[position], + namedArgument.value, isNonNullableByDefault ? inferredFormalType : legacyErasure(inferredFormalType), inferenceNeeded || isSpecialCasedBinaryOperator || - isSpecialCasedTernaryOperator || typeChecksNeeded); - inferredType = identical(result.inferredType, noInferredType) || - isNonNullableByDefault - ? result.inferredType - : legacyErasure(result.inferredType); + DartType inferredType = + identical(result.inferredType, noInferredType) || + isNonNullableByDefault + ? result.inferredType + : legacyErasure(result.inferredType); + if (localHoistedExpressions != null && + evaluationOrderIndex >= hoistingEndIndex) { + hoistedExpressions = null; + } Expression expression = _hoist(result.expression, inferredType, hoistedExpressions); - if (isIdentical && arguments.positional.length == 2) { - if (position == 0) { - flowAnalysis.equalityOp_rightBegin(expression, inferredType); - } else { - flowAnalysis.equalityOp_end( - arguments.parent as Expression, expression, inferredType); - } + namedArgument.value = expression..parent = namedArgument; + if (inferenceNeeded || typeChecksNeeded) { + formalTypes!.add(formalType); + actualTypes!.add(inferredType); } - arguments.positional[position] = expression..parent = arguments; - } - if (inferenceNeeded || typeChecksNeeded) { - formalTypes!.add(formalType); - actualTypes!.add(inferredType); } } + assert( + positionalIndex == arguments.positional.length, + "Expected 'positionalIndex' to be ${arguments.positional.length}, " + "got ${positionalIndex}."); + assert( + namedIndex == arguments.named.length, + "Expected 'namedIndex' to be ${arguments.named.length}, " + "got ${namedIndex}."); if (isSpecialCasedBinaryOperator) { calleeType = replaceReturnType( calleeType, @@ -2347,30 +2466,6 @@ typeSchemaEnvironment.getTypeOfSpecialCasedTernaryOperator( receiverType!, actualTypes![0], actualTypes[1], library.library)); } - for (NamedExpression namedArgument in arguments.named) { - DartType formalType = - getNamedParameterType(calleeType, namedArgument.name); - DartType inferredFormalType = substitution != null - ? substitution.substituteType(formalType) - : formalType; - ExpressionInferenceResult result = inferExpression( - namedArgument.value, - isNonNullableByDefault - ? inferredFormalType - : legacyErasure(inferredFormalType), - inferenceNeeded || isSpecialCasedBinaryOperator || typeChecksNeeded); - DartType inferredType = identical(result.inferredType, noInferredType) || - isNonNullableByDefault - ? result.inferredType - : legacyErasure(result.inferredType); - Expression expression = - _hoist(result.expression, inferredType, hoistedExpressions); - namedArgument.value = expression..parent = namedArgument; - if (inferenceNeeded || typeChecksNeeded) { - formalTypes!.add(formalType); - actualTypes!.add(inferredType); - } - } // Check for and remove duplicated named arguments. List<NamedExpression> named = arguments.named; @@ -2516,7 +2611,9 @@ calleeType = legacyErasure(calleeType) as FunctionType; } - return new SuccessfulInferenceResult(inferredType, calleeType); + return new SuccessfulInferenceResult(inferredType, calleeType, + hoistedArguments: localHoistedExpressions, + inferredReceiverType: receiverType); } FunctionType inferLocalFunction(FunctionNode function, DartType? typeContext, @@ -2767,7 +2864,7 @@ Link<NullAwareGuard> nullAwareGuards, Expression receiver, Name name, - Arguments arguments, + ArgumentsImpl arguments, DartType typeContext, List<VariableDeclaration>? hoistedExpressions, {required bool isImplicitCall}) { @@ -2792,7 +2889,7 @@ Expression receiver, NeverType receiverType, Name name, - Arguments arguments, + ArgumentsImpl arguments, DartType typeContext, List<VariableDeclaration>? hoistedExpressions, {required bool isImplicitCall}) { @@ -2820,7 +2917,7 @@ DartType receiverType, ObjectAccessTarget target, Name name, - Arguments arguments, + ArgumentsImpl arguments, DartType typeContext, List<VariableDeclaration>? hoistedExpressions, {required bool isExpressionInvocation, @@ -2854,7 +2951,7 @@ DartType receiverType, ObjectAccessTarget target, Name name, - Arguments arguments, + ArgumentsImpl arguments, DartType typeContext, List<VariableDeclaration>? hoistedExpressions, {required bool isImplicitCall}) { @@ -2905,8 +3002,8 @@ } else { StaticInvocation staticInvocation = transformExtensionMethodInvocation( fileOffset, target, receiver, arguments); - InvocationInferenceResult result = inferInvocation( - typeContext, fileOffset, functionType, staticInvocation.arguments, + InvocationInferenceResult result = inferInvocation(typeContext, + fileOffset, functionType, staticInvocation.arguments as ArgumentsImpl, hoistedExpressions: hoistedExpressions, receiverType: receiverType, isImplicitExtensionMember: true, @@ -2969,7 +3066,7 @@ Expression receiver, DartType receiverType, ObjectAccessTarget target, - Arguments arguments, + ArgumentsImpl arguments, DartType typeContext, List<VariableDeclaration>? hoistedExpressions, {required bool isImplicitCall}) { @@ -3122,8 +3219,8 @@ method.enclosingClass!, method.function.returnType)) { contravariantCheck = true; } - InvocationInferenceResult result = inferInvocation( - typeContext, fileOffset, declaredFunctionType, arguments, + InvocationInferenceResult result = inferInvocation(typeContext, fileOffset, + declaredFunctionType, arguments as ArgumentsImpl, hoistedExpressions: hoistedExpressions, receiverType: receiverType, isImplicitCall: isImplicitCall, @@ -3238,7 +3335,7 @@ Expression receiver, DartType receiverType, ObjectAccessTarget target, - Arguments arguments, + ArgumentsImpl arguments, DartType typeContext, List<VariableDeclaration>? hoistedExpressions, {required bool isExpressionInvocation}) { @@ -3445,7 +3542,7 @@ Expression receiver, DartType receiverType, ObjectAccessTarget target, - Arguments arguments, + ArgumentsImpl arguments, DartType typeContext, List<VariableDeclaration>? hoistedExpressions, {required bool isExpressionInvocation}) { @@ -3619,7 +3716,7 @@ Expression receiver, DartType receiverType, Name name, - Arguments arguments, + ArgumentsImpl arguments, DartType typeContext, {required bool isExpressionInvocation, required bool isImplicitCall, @@ -3842,7 +3939,7 @@ : const ObjectAccessTarget.missing(); int fileOffset = expression.fileOffset; Name methodName = expression.name; - Arguments arguments = expression.arguments; + ArgumentsImpl arguments = expression.arguments as ArgumentsImpl; DartType receiverType = thisType!; bool isSpecialCasedBinaryOperator = isSpecialCasedBinaryOperatorForReceiverType(target, receiverType); @@ -4772,10 +4869,65 @@ @override final FunctionType functionType; - SuccessfulInferenceResult(this.inferredType, this.functionType); + final List<VariableDeclaration>? hoistedArguments; + + final DartType? inferredReceiverType; + + SuccessfulInferenceResult(this.inferredType, this.functionType, + {this.hoistedArguments, this.inferredReceiverType}); @override - Expression applyResult(Expression expression) => expression; + Expression applyResult(Expression expression) { + List<VariableDeclaration>? hoistedArguments = this.hoistedArguments; + if (hoistedArguments == null || hoistedArguments.isEmpty) { + return expression; + } else { + assert(expression is InvocationExpression); + if (expression is FactoryConstructorInvocation) { + return _insertHoistedExpressions(expression, hoistedArguments); + } else if (expression is TypeAliasedConstructorInvocation) { + // Should be unaliased at this point, the code is for completeness. + return _insertHoistedExpressions(expression, hoistedArguments); + } else if (expression is TypeAliasedFactoryInvocation) { + // Should be unaliased at this point, the code is for completeness. + return expression; + } else if (expression is ConstructorInvocation) { + return _insertHoistedExpressions(expression, hoistedArguments); + } else if (expression is DynamicInvocation) { + return _insertHoistedExpressions(expression, hoistedArguments); + } else if (expression is FunctionInvocation) { + return _insertHoistedExpressions(expression, hoistedArguments); + } else if (expression is InstanceGetterInvocation) { + // The hoisting of InstanceGetterInvocation is performed elsewhere. + return expression; + } else if (expression is InstanceInvocation) { + VariableDeclaration receiver = createVariable( + expression.receiver, inferredReceiverType ?? const DynamicType()); + expression.receiver = createVariableGet(receiver)..parent = expression; + return createLet( + receiver, _insertHoistedExpressions(expression, hoistedArguments)); + } else if (expression is LocalFunctionInvocation) { + return _insertHoistedExpressions(expression, hoistedArguments); + } else if (expression is StaticInvocation) { + return _insertHoistedExpressions(expression, hoistedArguments); + } else if (expression is SuperMethodInvocation) { + return _insertHoistedExpressions(expression, hoistedArguments); + } else { + throw new StateError( + "Unhandled invocation kind '${expression.runtimeType}'."); + } + } + } + + static Expression _insertHoistedExpressions( + Expression expression, List<VariableDeclaration> hoistedExpressions) { + if (hoistedExpressions.isNotEmpty) { + for (int index = hoistedExpressions.length - 1; index >= 0; index--) { + expression = createLet(hoistedExpressions[index], expression); + } + } + return expression; + } @override bool get isInapplicable => false;
diff --git a/pkg/front_end/test/fasta/testing/suite.dart b/pkg/front_end/test/fasta/testing/suite.dart index 387f68f..4275910 100644 --- a/pkg/front_end/test/fasta/testing/suite.dart +++ b/pkg/front_end/test/fasta/testing/suite.dart
@@ -227,6 +227,7 @@ const List<Option> folderOptionsSpecification = [ Options.enableExperiment, + Options.enableUnscheduledExperiments, Options.forceLateLoweringSentinel, overwriteCurrentSdkVersion, Options.forceLateLowering, @@ -261,6 +262,7 @@ /// test folders. class FolderOptions { final Map<ExperimentalFlag, bool> _explicitExperimentalFlags; + final bool? enableUnscheduledExperiments; final int? forceLateLowerings; final bool? forceLateLoweringSentinel; final bool? forceStaticFieldLowering; @@ -273,7 +275,8 @@ final String? overwriteCurrentSdkVersion; FolderOptions(this._explicitExperimentalFlags, - {this.forceLateLowerings, + {this.enableUnscheduledExperiments, + this.forceLateLowerings, this.forceLateLoweringSentinel, this.forceStaticFieldLowering, this.forceNoExplicitGetterCalls, @@ -441,6 +444,7 @@ FolderOptions _computeFolderOptions(Directory directory) { FolderOptions? folderOptions = _folderOptions[directory.uri]; if (folderOptions == null) { + bool? enableUnscheduledExperiments; int? forceLateLowering; bool? forceLateLoweringSentinel; bool? forceStaticFieldLowering; @@ -452,6 +456,7 @@ String target = "vm"; if (directory.uri == baseUri) { folderOptions = new FolderOptions({}, + enableUnscheduledExperiments: enableUnscheduledExperiments, forceLateLowerings: forceLateLowering, forceLateLoweringSentinel: forceLateLoweringSentinel, forceStaticFieldLowering: forceStaticFieldLowering, @@ -473,6 +478,8 @@ Options.enableExperiment.read(parsedOptions) ?? <String>[]; String overwriteCurrentSdkVersionArgument = overwriteCurrentSdkVersion.read(parsedOptions); + enableUnscheduledExperiments = + Options.enableUnscheduledExperiments.read(parsedOptions); forceLateLoweringSentinel = Options.forceLateLoweringSentinel.read(parsedOptions); forceLateLowering = Options.forceLateLowering.read(parsedOptions); @@ -499,6 +506,7 @@ onError: (String message) => throw new ArgumentError(message), onWarning: (String message) => throw new ArgumentError(message)), + enableUnscheduledExperiments: enableUnscheduledExperiments, forceLateLowerings: forceLateLowering, forceLateLoweringSentinel: forceLateLoweringSentinel, forceStaticFieldLowering: forceStaticFieldLowering, @@ -541,6 +549,8 @@ } ..sdkRoot = sdk ..packagesFileUri = uriConfiguration.packageConfigUri ?? packages + ..enableUnscheduledExperiments = + folderOptions.enableUnscheduledExperiments ?? false ..environmentDefines = folderOptions.defines ..explicitExperimentalFlags = folderOptions .computeExplicitExperimentalFlags(explicitExperimentalFlags) @@ -1094,6 +1104,8 @@ ..onDiagnostic = (DiagnosticMessage message) { errors.add(message.plainTextFormatted); } + ..enableUnscheduledExperiments = + folderOptions.enableUnscheduledExperiments ?? false ..environmentDefines = folderOptions.defines ..explicitExperimentalFlags = experimentalFlags ..nnbdMode = nnbdMode
diff --git a/pkg/front_end/test/spell_checking_list_common.txt b/pkg/front_end/test/spell_checking_list_common.txt index dd9f732..93046af 100644 --- a/pkg/front_end/test/spell_checking_list_common.txt +++ b/pkg/front_end/test/spell_checking_list_common.txt
@@ -488,6 +488,7 @@ closures clue code +coincides coinductively collapses collect @@ -1397,6 +1398,7 @@ historically hoist hoisted +hoisting hold holder holding @@ -2574,6 +2576,7 @@ resynthesize retain retained +retains rethrow rethrowing retired @@ -3218,6 +3221,7 @@ unresolved unsafe unsatisfied +unscheduled unserializable unsigned unsized
diff --git a/pkg/front_end/testcases/unscheduled_experiments/folder.options b/pkg/front_end/testcases/unscheduled_experiments/folder.options new file mode 100644 index 0000000..b931072 --- /dev/null +++ b/pkg/front_end/testcases/unscheduled_experiments/folder.options
@@ -0,0 +1 @@ +--enable-unscheduled-experiments \ No newline at end of file
diff --git a/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart new file mode 100644 index 0000000..2c51514 --- /dev/null +++ b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart
@@ -0,0 +1,82 @@ +class A { + A(int x, int y, {required int z}); + + factory A.foo(int x, int y, {required int z}) => new A(x, y, z: z); + + void Function(int x, int y, {required int z}) get property => throw 42; + + void bar(int x, int y, {required int z}) {} +} + +typedef B = A; + +foo(int x, int y, {required int z}) {} + +extension E on A { + method1() { + method2(foo: 1, 2); // This call. + } + method2(int bar, {int? foo}) {} +} + +test(dynamic d, Function f, A a) { + void local(int x, int y, {required int z}) {} + + // StaticInvocation. + foo(1, 2, z: 3); + foo(1, z: 2, 3); + foo(z: 1, 2, 3); + + // FactoryConstructorInvocation. + new A.foo(1, 2, z: 3); + new A.foo(1, z: 2, 3); + new A.foo(z: 1, 2, 3); + new B.foo(1, 2, z: 3); + new B.foo(1, z: 2, 3); + new B.foo(z: 1, 2, 3); + + // ConstructorInvocation. + new A(1, 2, z: 3); + new A(1, z: 2, 3); + new A(z: 1, 2, 3); + new B(1, 2, z: 3); + new B(1, z: 2, 3); + new B(z: 1, 2, 3); + + // DynamicInvocation. + d(1, 2, z: 3); + d(1, z: 2, 3); + d(z: 1, 2, 3); + + // FunctionInvocation. + f(1, 2, z: 3); + f(1, z: 2, 3); + f(z: 1, 2, 3); + + // InstanceGetterInvocation. + a.property(1, 2, z: 3); + a.property(1, z: 2, 3); + a.property(z: 1, 2, 3); + + // InstanceInvocation. + a.bar(1, 2, z: 3); + a.bar(1, z: 2, 3); + a.bar(z: 1, 2, 3); + + // LocalFunctionInvocation. + local(1, 2, z: 3); + local(1, z: 2, 3); + local(z: 1, 2, 3); +} + +class Test extends A { + Test() : super(1, 2, z: 3); + + test() { + super.bar(1, 2, z: 3); + super.bar(1, z: 2, 3); + super.bar(z: 1, 2, 3); + } +} + +main() {}
diff --git a/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.strong.expect b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.strong.expect new file mode 100644 index 0000000..c92d158 --- /dev/null +++ b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.strong.expect
@@ -0,0 +1,251 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:17:21: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// method2(foo: 1, 2); // This call. +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:27:16: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:28:13: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:28:16: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:32:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:33:19: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:33:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:35:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:36:19: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:36:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:40:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:41:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:41:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:43:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:44:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:44:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:48:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:49:11: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:49:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:53:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:54:11: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:54:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:58:23: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:59:20: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:59:23: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:63:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:64:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:64:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:68:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:69:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:69:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:77:24: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:78:21: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:78:24: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(z: 1, 2, 3); +// ^ +// +import self as self; +import "dart:core" as core; + +typedef B = self::A; +class A extends core::Object { + constructor •(core::int x, core::int y, {required core::int z = #C1}) → self::A + : super core::Object::•() + ; + static factory foo(core::int x, core::int y, {required core::int z = #C1}) → self::A + return new self::A::•(x, y, z: z); + get property() → (core::int, core::int, {required z: core::int}) → void + return throw 42; + method bar(core::int x, core::int y, {required core::int z = #C1}) → void {} +} +class Test extends self::A { + constructor •() → self::Test + : super self::A::•(1, 2, z: 3) + ; + method test() → dynamic { + super.{self::A::bar}(1, 2, z: 3); + let final core::int #t1 = 1 in let final core::int #t2 = 2 in super.{self::A::bar}(#t1, 3, z: #t2); + let final core::int #t3 = 1 in super.{self::A::bar}(2, 3, z: #t3); + } +} +extension E on self::A { + method method1 = self::E|method1; + tearoff method1 = self::E|get#method1; + method method2 = self::E|method2; + tearoff method2 = self::E|get#method2; +} +static method foo(core::int x, core::int y, {required core::int z = #C1}) → dynamic {} +static method E|method1(lowered final self::A #this) → dynamic { + let final self::A #t4 = #this in let final core::int #t5 = 1 in self::E|method2(#t4, 2, foo: #t5); +} +static method E|get#method1(lowered final self::A #this) → () → dynamic + return () → dynamic => self::E|method1(#this); +static method E|method2(lowered final self::A #this, core::int bar, {core::int? foo = #C1}) → dynamic {} +static method E|get#method2(lowered final self::A #this) → (core::int, {foo: core::int?}) → dynamic + return (core::int bar, {core::int? foo = #C1}) → dynamic => self::E|method2(#this, bar, foo: foo); +static method test(dynamic d, core::Function f, self::A a) → dynamic { + function local(core::int x, core::int y, {required core::int z = #C1}) → void {} + self::foo(1, 2, z: 3); + let final core::int #t6 = 1 in let final core::int #t7 = 2 in self::foo(#t6, 3, z: #t7); + let final core::int #t8 = 1 in self::foo(2, 3, z: #t8); + self::A::foo(1, 2, z: 3); + let final core::int #t9 = 1 in let final core::int #t10 = 2 in self::A::foo(#t9, 3, z: #t10); + let final core::int #t11 = 1 in self::A::foo(2, 3, z: #t11); + self::A::foo(1, 2, z: 3); + let final core::int #t12 = 1 in let final core::int #t13 = 2 in self::A::foo(#t12, 3, z: #t13); + let final core::int #t14 = 1 in self::A::foo(2, 3, z: #t14); + new self::A::•(1, 2, z: 3); + let final core::int #t15 = 1 in let final core::int #t16 = 2 in new self::A::•(#t15, 3, z: #t16); + let final core::int #t17 = 1 in new self::A::•(2, 3, z: #t17); + new self::A::•(1, 2, z: 3); + let final core::int #t18 = 1 in let final core::int #t19 = 2 in new self::A::•(#t18, 3, z: #t19); + let final core::int #t20 = 1 in new self::A::•(2, 3, z: #t20); + d{dynamic}.call(1, 2, z: 3); + let final core::int #t21 = 1 in let final core::int #t22 = 2 in d{dynamic}.call(#t21, 3, z: #t22); + let final core::int #t23 = 1 in d{dynamic}.call(2, 3, z: #t23); + f(1, 2, z: 3); + let final core::int #t24 = 1 in let final core::int #t25 = 2 in f(#t24, 3, z: #t25); + let final core::int #t26 = 1 in f(2, 3, z: #t26); + let final self::A #t27 = a in let final core::int #t28 = 1 in let final core::int #t29 = 2 in let final core::int #t30 = 3 in #t27.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t28, #t29, z: #t30){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t31 = a in let final core::int #t32 = 1 in let final core::int #t33 = 2 in let final core::int #t34 = 3 in #t31.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t32, #t34, z: #t33){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t35 = a in let final core::int #t36 = 1 in let final core::int #t37 = 2 in let final core::int #t38 = 3 in #t35.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t37, #t38, z: #t36){(core::int, core::int, {required z: core::int}) → void}; + a.{self::A::bar}(1, 2, z: 3){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t39 = a in let final core::int #t40 = 1 in let final core::int #t41 = 2 in #t39.{self::A::bar}(#t40, 3, z: #t41){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t42 = a in let final core::int #t43 = 1 in #t42.{self::A::bar}(2, 3, z: #t43){(core::int, core::int, {required z: core::int}) → void}; + local(1, 2, z: 3){(core::int, core::int, {required z: core::int}) → void}; + let final core::int #t44 = 1 in let final core::int #t45 = 2 in local(#t44, 3, z: #t45){(core::int, core::int, {required z: core::int}) → void}; + let final core::int #t46 = 1 in local(2, 3, z: #t46){(core::int, core::int, {required z: core::int}) → void}; +} +static method main() → dynamic {} + +constants { + #C1 = null +}
diff --git a/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.strong.transformed.expect b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.strong.transformed.expect new file mode 100644 index 0000000..82faf76 --- /dev/null +++ b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.strong.transformed.expect
@@ -0,0 +1,294 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:17:21: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// method2(foo: 1, 2); // This call. +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:27:16: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:28:13: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:28:16: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:32:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:33:19: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:33:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:35:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:36:19: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:36:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:40:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:41:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:41:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:43:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:44:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:44:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:48:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:49:11: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:49:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:53:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:54:11: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:54:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:58:23: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:59:20: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:59:23: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:63:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:64:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:64:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:68:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:69:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:69:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:77:24: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:78:21: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:78:24: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(z: 1, 2, 3); +// ^ +// +import self as self; +import "dart:core" as core; + +typedef B = self::A; +class A extends core::Object { + constructor •(core::int x, core::int y, {required core::int z = #C1}) → self::A + : super core::Object::•() + ; + static factory foo(core::int x, core::int y, {required core::int z = #C1}) → self::A + return new self::A::•(x, y, z: z); + get property() → (core::int, core::int, {required z: core::int}) → void + return throw 42; + method bar(core::int x, core::int y, {required core::int z = #C1}) → void {} +} +class Test extends self::A { + constructor •() → self::Test + : super self::A::•(1, 2, z: 3) + ; + method test() → dynamic { + super.{self::A::bar}(1, 2, z: 3); + let final core::int #t1 = 1 in let final core::int #t2 = 2 in super.{self::A::bar}(#t1, 3, z: #t2); + let final core::int #t3 = 1 in super.{self::A::bar}(2, 3, z: #t3); + } +} +extension E on self::A { + method method1 = self::E|method1; + tearoff method1 = self::E|get#method1; + method method2 = self::E|method2; + tearoff method2 = self::E|get#method2; +} +static method foo(core::int x, core::int y, {required core::int z = #C1}) → dynamic {} +static method E|method1(lowered final self::A #this) → dynamic { + let final self::A #t4 = #this in let final core::int #t5 = 1 in self::E|method2(#t4, 2, foo: #t5); +} +static method E|get#method1(lowered final self::A #this) → () → dynamic + return () → dynamic => self::E|method1(#this); +static method E|method2(lowered final self::A #this, core::int bar, {core::int? foo = #C1}) → dynamic {} +static method E|get#method2(lowered final self::A #this) → (core::int, {foo: core::int?}) → dynamic + return (core::int bar, {core::int? foo = #C1}) → dynamic => self::E|method2(#this, bar, foo: foo); +static method test(dynamic d, core::Function f, self::A a) → dynamic { + function local(core::int x, core::int y, {required core::int z = #C1}) → void {} + self::foo(1, 2, z: 3); + let final core::int #t6 = 1 in let final core::int #t7 = 2 in self::foo(#t6, 3, z: #t7); + let final core::int #t8 = 1 in self::foo(2, 3, z: #t8); + self::A::foo(1, 2, z: 3); + let final core::int #t9 = 1 in let final core::int #t10 = 2 in self::A::foo(#t9, 3, z: #t10); + let final core::int #t11 = 1 in self::A::foo(2, 3, z: #t11); + self::A::foo(1, 2, z: 3); + let final core::int #t12 = 1 in let final core::int #t13 = 2 in self::A::foo(#t12, 3, z: #t13); + let final core::int #t14 = 1 in self::A::foo(2, 3, z: #t14); + new self::A::•(1, 2, z: 3); + let final core::int #t15 = 1 in let final core::int #t16 = 2 in new self::A::•(#t15, 3, z: #t16); + let final core::int #t17 = 1 in new self::A::•(2, 3, z: #t17); + new self::A::•(1, 2, z: 3); + let final core::int #t18 = 1 in let final core::int #t19 = 2 in new self::A::•(#t18, 3, z: #t19); + let final core::int #t20 = 1 in new self::A::•(2, 3, z: #t20); + d{dynamic}.call(1, 2, z: 3); + let final core::int #t21 = 1 in let final core::int #t22 = 2 in d{dynamic}.call(#t21, 3, z: #t22); + let final core::int #t23 = 1 in d{dynamic}.call(2, 3, z: #t23); + f(1, 2, z: 3); + let final core::int #t24 = 1 in let final core::int #t25 = 2 in f(#t24, 3, z: #t25); + let final core::int #t26 = 1 in f(2, 3, z: #t26); + let final self::A #t27 = a in let final core::int #t28 = 1 in let final core::int #t29 = 2 in let final core::int #t30 = 3 in #t27.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t28, #t29, z: #t30){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t31 = a in let final core::int #t32 = 1 in let final core::int #t33 = 2 in let final core::int #t34 = 3 in #t31.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t32, #t34, z: #t33){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t35 = a in let final core::int #t36 = 1 in let final core::int #t37 = 2 in let final core::int #t38 = 3 in #t35.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t37, #t38, z: #t36){(core::int, core::int, {required z: core::int}) → void}; + a.{self::A::bar}(1, 2, z: 3){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t39 = a in let final core::int #t40 = 1 in let final core::int #t41 = 2 in #t39.{self::A::bar}(#t40, 3, z: #t41){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t42 = a in let final core::int #t43 = 1 in #t42.{self::A::bar}(2, 3, z: #t43){(core::int, core::int, {required z: core::int}) → void}; + local(1, 2, z: 3){(core::int, core::int, {required z: core::int}) → void}; + let final core::int #t44 = 1 in let final core::int #t45 = 2 in local(#t44, 3, z: #t45){(core::int, core::int, {required z: core::int}) → void}; + let final core::int #t46 = 1 in local(2, 3, z: #t46){(core::int, core::int, {required z: core::int}) → void}; +} +static method main() → dynamic {} + +constants { + #C1 = null +} + +Extra constant evaluation status: +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:77:15 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:77:21 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:78:18 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:17:18 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:27:7 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:27:13 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:28:10 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:32:13 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:32:19 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:33:16 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:35:13 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:35:19 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:36:16 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:40:9 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:40:15 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:41:12 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:43:9 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:43:15 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:44:12 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:48:5 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:48:11 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:49:8 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:53:5 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:53:11 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:54:8 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:57:14 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:57:17 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:57:23 -> IntConstant(3) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:58:14 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:58:23 -> IntConstant(3) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:58:20 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:59:20 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:59:23 -> IntConstant(3) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:59:17 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:63:9 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:63:15 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:64:12 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:68:9 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:68:15 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:69:12 -> IntConstant(1) +Extra constant evaluation: evaluated: 155, effectively constant: 40
diff --git a/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.textual_outline.expect b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.textual_outline.expect new file mode 100644 index 0000000..903b3b6 --- /dev/null +++ b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.textual_outline.expect
@@ -0,0 +1,23 @@ +class A { + A(int x, int y, {required int z}); + factory A.foo(int x, int y, {required int z}) => new A(x, y, z: z); + void Function(int x, int y, {required int z}) get property => throw 42; + void bar(int x, int y, {required int z}) {} +} + +typedef B = A; +foo(int x, int y, {required int z}) {} + +extension E on A { + method1() {} + method2(int bar, {int? foo}) {} +} + +test(dynamic d, Function f, A a) {} + +class Test extends A { + Test() : super(1, 2, z: 3); + test() {} +} + +main() {}
diff --git a/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.textual_outline_modelled.expect new file mode 100644 index 0000000..f0b79da --- /dev/null +++ b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.textual_outline_modelled.expect
@@ -0,0 +1,21 @@ +class A { + A(int x, int y, {required int z}); + factory A.foo(int x, int y, {required int z}) => new A(x, y, z: z); + void Function(int x, int y, {required int z}) get property => throw 42; + void bar(int x, int y, {required int z}) {} +} + +class Test extends A { + Test() : super(1, 2, z: 3); + test() {} +} + +extension E on A { + method1() {} + method2(int bar, {int? foo}) {} +} + +foo(int x, int y, {required int z}) {} +main() {} +test(dynamic d, Function f, A a) {} +typedef B = A;
diff --git a/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.weak.expect b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.weak.expect new file mode 100644 index 0000000..c92d158 --- /dev/null +++ b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.weak.expect
@@ -0,0 +1,251 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:17:21: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// method2(foo: 1, 2); // This call. +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:27:16: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:28:13: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:28:16: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:32:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:33:19: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:33:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:35:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:36:19: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:36:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:40:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:41:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:41:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:43:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:44:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:44:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:48:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:49:11: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:49:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:53:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:54:11: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:54:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:58:23: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:59:20: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:59:23: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:63:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:64:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:64:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:68:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:69:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:69:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:77:24: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:78:21: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:78:24: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(z: 1, 2, 3); +// ^ +// +import self as self; +import "dart:core" as core; + +typedef B = self::A; +class A extends core::Object { + constructor •(core::int x, core::int y, {required core::int z = #C1}) → self::A + : super core::Object::•() + ; + static factory foo(core::int x, core::int y, {required core::int z = #C1}) → self::A + return new self::A::•(x, y, z: z); + get property() → (core::int, core::int, {required z: core::int}) → void + return throw 42; + method bar(core::int x, core::int y, {required core::int z = #C1}) → void {} +} +class Test extends self::A { + constructor •() → self::Test + : super self::A::•(1, 2, z: 3) + ; + method test() → dynamic { + super.{self::A::bar}(1, 2, z: 3); + let final core::int #t1 = 1 in let final core::int #t2 = 2 in super.{self::A::bar}(#t1, 3, z: #t2); + let final core::int #t3 = 1 in super.{self::A::bar}(2, 3, z: #t3); + } +} +extension E on self::A { + method method1 = self::E|method1; + tearoff method1 = self::E|get#method1; + method method2 = self::E|method2; + tearoff method2 = self::E|get#method2; +} +static method foo(core::int x, core::int y, {required core::int z = #C1}) → dynamic {} +static method E|method1(lowered final self::A #this) → dynamic { + let final self::A #t4 = #this in let final core::int #t5 = 1 in self::E|method2(#t4, 2, foo: #t5); +} +static method E|get#method1(lowered final self::A #this) → () → dynamic + return () → dynamic => self::E|method1(#this); +static method E|method2(lowered final self::A #this, core::int bar, {core::int? foo = #C1}) → dynamic {} +static method E|get#method2(lowered final self::A #this) → (core::int, {foo: core::int?}) → dynamic + return (core::int bar, {core::int? foo = #C1}) → dynamic => self::E|method2(#this, bar, foo: foo); +static method test(dynamic d, core::Function f, self::A a) → dynamic { + function local(core::int x, core::int y, {required core::int z = #C1}) → void {} + self::foo(1, 2, z: 3); + let final core::int #t6 = 1 in let final core::int #t7 = 2 in self::foo(#t6, 3, z: #t7); + let final core::int #t8 = 1 in self::foo(2, 3, z: #t8); + self::A::foo(1, 2, z: 3); + let final core::int #t9 = 1 in let final core::int #t10 = 2 in self::A::foo(#t9, 3, z: #t10); + let final core::int #t11 = 1 in self::A::foo(2, 3, z: #t11); + self::A::foo(1, 2, z: 3); + let final core::int #t12 = 1 in let final core::int #t13 = 2 in self::A::foo(#t12, 3, z: #t13); + let final core::int #t14 = 1 in self::A::foo(2, 3, z: #t14); + new self::A::•(1, 2, z: 3); + let final core::int #t15 = 1 in let final core::int #t16 = 2 in new self::A::•(#t15, 3, z: #t16); + let final core::int #t17 = 1 in new self::A::•(2, 3, z: #t17); + new self::A::•(1, 2, z: 3); + let final core::int #t18 = 1 in let final core::int #t19 = 2 in new self::A::•(#t18, 3, z: #t19); + let final core::int #t20 = 1 in new self::A::•(2, 3, z: #t20); + d{dynamic}.call(1, 2, z: 3); + let final core::int #t21 = 1 in let final core::int #t22 = 2 in d{dynamic}.call(#t21, 3, z: #t22); + let final core::int #t23 = 1 in d{dynamic}.call(2, 3, z: #t23); + f(1, 2, z: 3); + let final core::int #t24 = 1 in let final core::int #t25 = 2 in f(#t24, 3, z: #t25); + let final core::int #t26 = 1 in f(2, 3, z: #t26); + let final self::A #t27 = a in let final core::int #t28 = 1 in let final core::int #t29 = 2 in let final core::int #t30 = 3 in #t27.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t28, #t29, z: #t30){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t31 = a in let final core::int #t32 = 1 in let final core::int #t33 = 2 in let final core::int #t34 = 3 in #t31.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t32, #t34, z: #t33){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t35 = a in let final core::int #t36 = 1 in let final core::int #t37 = 2 in let final core::int #t38 = 3 in #t35.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t37, #t38, z: #t36){(core::int, core::int, {required z: core::int}) → void}; + a.{self::A::bar}(1, 2, z: 3){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t39 = a in let final core::int #t40 = 1 in let final core::int #t41 = 2 in #t39.{self::A::bar}(#t40, 3, z: #t41){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t42 = a in let final core::int #t43 = 1 in #t42.{self::A::bar}(2, 3, z: #t43){(core::int, core::int, {required z: core::int}) → void}; + local(1, 2, z: 3){(core::int, core::int, {required z: core::int}) → void}; + let final core::int #t44 = 1 in let final core::int #t45 = 2 in local(#t44, 3, z: #t45){(core::int, core::int, {required z: core::int}) → void}; + let final core::int #t46 = 1 in local(2, 3, z: #t46){(core::int, core::int, {required z: core::int}) → void}; +} +static method main() → dynamic {} + +constants { + #C1 = null +}
diff --git a/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.weak.outline.expect b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.weak.outline.expect new file mode 100644 index 0000000..23ee911 --- /dev/null +++ b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.weak.outline.expect
@@ -0,0 +1,41 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +typedef B = self::A; +class A extends core::Object { + constructor •(core::int x, core::int y, {required core::int z}) → self::A + ; + static factory foo(core::int x, core::int y, {required core::int z}) → self::A + ; + get property() → (core::int, core::int, {required z: core::int}) → void + ; + method bar(core::int x, core::int y, {required core::int z}) → void + ; +} +class Test extends self::A { + constructor •() → self::Test + ; + method test() → dynamic + ; +} +extension E on self::A { + method method1 = self::E|method1; + tearoff method1 = self::E|get#method1; + method method2 = self::E|method2; + tearoff method2 = self::E|get#method2; +} +static method foo(core::int x, core::int y, {required core::int z}) → dynamic + ; +static method E|method1(lowered final self::A #this) → dynamic + ; +static method E|get#method1(lowered final self::A #this) → () → dynamic + return () → dynamic => self::E|method1(#this); +static method E|method2(lowered final self::A #this, core::int bar, {core::int? foo}) → dynamic + ; +static method E|get#method2(lowered final self::A #this) → (core::int, {foo: core::int?}) → dynamic + return (core::int bar, {core::int? foo}) → dynamic => self::E|method2(#this, bar, foo: foo); +static method test(dynamic d, core::Function f, self::A a) → dynamic + ; +static method main() → dynamic + ;
diff --git a/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.weak.transformed.expect b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.weak.transformed.expect new file mode 100644 index 0000000..82faf76 --- /dev/null +++ b/pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart.weak.transformed.expect
@@ -0,0 +1,294 @@ +library /*isNonNullableByDefault*/; +// +// Problems in library: +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:17:21: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// method2(foo: 1, 2); // This call. +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:27:16: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:28:13: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:28:16: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:32:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:33:19: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:33:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:35:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:36:19: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:36:22: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B.foo(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:40:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:41:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:41:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new A(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:43:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:44:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:44:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// new B(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:48:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:49:11: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:49:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// d(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:53:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:54:11: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:54:14: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// f(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:58:23: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:59:20: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:59:23: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.property(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:63:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:64:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:64:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// a.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:68:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:69:15: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:69:18: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// local(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:77:24: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(1, z: 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:78:21: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(z: 1, 2, 3); +// ^ +// +// pkg/front_end/testcases/unscheduled_experiments/named_arguments_anywhere/all_kinds.dart:78:24: Error: Place positional arguments before named arguments. +// Try moving the positional argument before the named arguments, or add a name to the argument. +// super.bar(z: 1, 2, 3); +// ^ +// +import self as self; +import "dart:core" as core; + +typedef B = self::A; +class A extends core::Object { + constructor •(core::int x, core::int y, {required core::int z = #C1}) → self::A + : super core::Object::•() + ; + static factory foo(core::int x, core::int y, {required core::int z = #C1}) → self::A + return new self::A::•(x, y, z: z); + get property() → (core::int, core::int, {required z: core::int}) → void + return throw 42; + method bar(core::int x, core::int y, {required core::int z = #C1}) → void {} +} +class Test extends self::A { + constructor •() → self::Test + : super self::A::•(1, 2, z: 3) + ; + method test() → dynamic { + super.{self::A::bar}(1, 2, z: 3); + let final core::int #t1 = 1 in let final core::int #t2 = 2 in super.{self::A::bar}(#t1, 3, z: #t2); + let final core::int #t3 = 1 in super.{self::A::bar}(2, 3, z: #t3); + } +} +extension E on self::A { + method method1 = self::E|method1; + tearoff method1 = self::E|get#method1; + method method2 = self::E|method2; + tearoff method2 = self::E|get#method2; +} +static method foo(core::int x, core::int y, {required core::int z = #C1}) → dynamic {} +static method E|method1(lowered final self::A #this) → dynamic { + let final self::A #t4 = #this in let final core::int #t5 = 1 in self::E|method2(#t4, 2, foo: #t5); +} +static method E|get#method1(lowered final self::A #this) → () → dynamic + return () → dynamic => self::E|method1(#this); +static method E|method2(lowered final self::A #this, core::int bar, {core::int? foo = #C1}) → dynamic {} +static method E|get#method2(lowered final self::A #this) → (core::int, {foo: core::int?}) → dynamic + return (core::int bar, {core::int? foo = #C1}) → dynamic => self::E|method2(#this, bar, foo: foo); +static method test(dynamic d, core::Function f, self::A a) → dynamic { + function local(core::int x, core::int y, {required core::int z = #C1}) → void {} + self::foo(1, 2, z: 3); + let final core::int #t6 = 1 in let final core::int #t7 = 2 in self::foo(#t6, 3, z: #t7); + let final core::int #t8 = 1 in self::foo(2, 3, z: #t8); + self::A::foo(1, 2, z: 3); + let final core::int #t9 = 1 in let final core::int #t10 = 2 in self::A::foo(#t9, 3, z: #t10); + let final core::int #t11 = 1 in self::A::foo(2, 3, z: #t11); + self::A::foo(1, 2, z: 3); + let final core::int #t12 = 1 in let final core::int #t13 = 2 in self::A::foo(#t12, 3, z: #t13); + let final core::int #t14 = 1 in self::A::foo(2, 3, z: #t14); + new self::A::•(1, 2, z: 3); + let final core::int #t15 = 1 in let final core::int #t16 = 2 in new self::A::•(#t15, 3, z: #t16); + let final core::int #t17 = 1 in new self::A::•(2, 3, z: #t17); + new self::A::•(1, 2, z: 3); + let final core::int #t18 = 1 in let final core::int #t19 = 2 in new self::A::•(#t18, 3, z: #t19); + let final core::int #t20 = 1 in new self::A::•(2, 3, z: #t20); + d{dynamic}.call(1, 2, z: 3); + let final core::int #t21 = 1 in let final core::int #t22 = 2 in d{dynamic}.call(#t21, 3, z: #t22); + let final core::int #t23 = 1 in d{dynamic}.call(2, 3, z: #t23); + f(1, 2, z: 3); + let final core::int #t24 = 1 in let final core::int #t25 = 2 in f(#t24, 3, z: #t25); + let final core::int #t26 = 1 in f(2, 3, z: #t26); + let final self::A #t27 = a in let final core::int #t28 = 1 in let final core::int #t29 = 2 in let final core::int #t30 = 3 in #t27.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t28, #t29, z: #t30){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t31 = a in let final core::int #t32 = 1 in let final core::int #t33 = 2 in let final core::int #t34 = 3 in #t31.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t32, #t34, z: #t33){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t35 = a in let final core::int #t36 = 1 in let final core::int #t37 = 2 in let final core::int #t38 = 3 in #t35.{self::A::property}{(core::int, core::int, {required z: core::int}) → void}(#t37, #t38, z: #t36){(core::int, core::int, {required z: core::int}) → void}; + a.{self::A::bar}(1, 2, z: 3){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t39 = a in let final core::int #t40 = 1 in let final core::int #t41 = 2 in #t39.{self::A::bar}(#t40, 3, z: #t41){(core::int, core::int, {required z: core::int}) → void}; + let final self::A #t42 = a in let final core::int #t43 = 1 in #t42.{self::A::bar}(2, 3, z: #t43){(core::int, core::int, {required z: core::int}) → void}; + local(1, 2, z: 3){(core::int, core::int, {required z: core::int}) → void}; + let final core::int #t44 = 1 in let final core::int #t45 = 2 in local(#t44, 3, z: #t45){(core::int, core::int, {required z: core::int}) → void}; + let final core::int #t46 = 1 in local(2, 3, z: #t46){(core::int, core::int, {required z: core::int}) → void}; +} +static method main() → dynamic {} + +constants { + #C1 = null +} + +Extra constant evaluation status: +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:77:15 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:77:21 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:78:18 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:17:18 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:27:7 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:27:13 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:28:10 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:32:13 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:32:19 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:33:16 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:35:13 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:35:19 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:36:16 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:40:9 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:40:15 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:41:12 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:43:9 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:43:15 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:44:12 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:48:5 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:48:11 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:49:8 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:53:5 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:53:11 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:54:8 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:57:14 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:57:17 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:57:23 -> IntConstant(3) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:58:14 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:58:23 -> IntConstant(3) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:58:20 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:59:20 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:59:23 -> IntConstant(3) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:59:17 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:63:9 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:63:15 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:64:12 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:68:9 -> IntConstant(1) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:68:15 -> IntConstant(2) +Evaluated: VariableGet @ org-dartlang-testcase:///all_kinds.dart:69:12 -> IntConstant(1) +Extra constant evaluation: evaluated: 155, effectively constant: 40
diff --git a/pkg/front_end/tool/_fasta/command_line.dart b/pkg/front_end/tool/_fasta/command_line.dart index 61caaf3..d8a5ab1 100644 --- a/pkg/front_end/tool/_fasta/command_line.dart +++ b/pkg/front_end/tool/_fasta/command_line.dart
@@ -60,6 +60,7 @@ Options.compileSdk, Options.dumpIr, Options.enableExperiment, + Options.enableUnscheduledExperiments, Options.excludeSource, Options.omitPlatform, Options.fatal, @@ -188,6 +189,9 @@ ? NnbdMode.Agnostic : (nnbdStrongMode ? NnbdMode.Strong : NnbdMode.Weak); + final bool enableUnscheduledExperiments = + Options.enableUnscheduledExperiments.read(parsedOptions); + final bool warnOnReachabilityCheck = Options.warnOnReachabilityCheck.read(parsedOptions); @@ -247,6 +251,7 @@ ..explicitExperimentalFlags = explicitExperimentalFlags ..environmentDefines = noDefines ? null : parsedOptions.defines ..nnbdMode = nnbdMode + ..enableUnscheduledExperiments = enableUnscheduledExperiments ..additionalDills = linkDependencies ..emitDeps = !noDeps ..warnOnReachabilityCheck = warnOnReachabilityCheck