diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 99ccd1bb4ee..48a5828e3a1 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -81,6 +81,8 @@ def _CheckFormat(input_api, for git_file in input_api.AffectedTextFiles(): if git_file.LocalPath().startswith("pkg/front_end/testcases/"): continue + if git_file.LocalPath().startswith("pkg/front_end/parser_testcases/"): + continue if should_skip(git_file.LocalPath()): continue filename = git_file.AbsoluteLocalPath() diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart b/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart index 84f65f6f921..d5998197c66 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/type_info.dart @@ -39,6 +39,8 @@ abstract class TypeInfo { /// Returns true if the type has type arguments. bool get hasTypeArguments; + bool get recovered => false; + /// Call this function when the token after [token] must be a type (not void). /// This function will call the appropriate event methods on the [Parser]'s /// listener to handle the type, inserting a synthetic type reference if @@ -150,6 +152,7 @@ TypeInfo computeType(final Token token, bool required, [bool inDeclaration = false, bool acceptKeywordForSimpleType = false]) { Token next = token.next!; if (!isValidTypeReference(next)) { + // As next is not a valid type reference, this is all recovery. if (next.type.isBuiltIn) { TypeParamOrArgInfo typeParamOrArg = computeTypeParamOrArg(next, inDeclaration); @@ -157,7 +160,8 @@ TypeInfo computeType(final Token token, bool required, // Recovery: built-in `<` ... `>` if (required || looksLikeName(typeParamOrArg.skip(next).next!)) { return new ComplexTypeInfo(token, typeParamOrArg) - .computeBuiltinOrVarAsType(required); + .computeBuiltinOrVarAsType(required) + ..recovered = true; } } else if (required || isGeneralizedFunctionType(next.next!)) { String? value = next.stringValue; @@ -167,21 +171,25 @@ TypeInfo computeType(final Token token, bool required, !identical('operator', value) && !(identical('typedef', value) && next.next!.isIdentifier))) { return new ComplexTypeInfo(token, typeParamOrArg) - .computeBuiltinOrVarAsType(required); + .computeBuiltinOrVarAsType(required) + ..recovered = true; } } } else if (required) { // Recovery if (optional('.', next)) { // Looks like prefixed type missing the prefix - return new ComplexTypeInfo( + TypeInfo result = new ComplexTypeInfo( token, computeTypeParamOrArg(next, inDeclaration)) .computePrefixedType(required); + if (result is ComplexTypeInfo) result.recovered = true; + return result; } else if (optional('var', next) && isOneOf(next.next!, const ['<', ',', '>'])) { return new ComplexTypeInfo( token, computeTypeParamOrArg(next, inDeclaration)) - .computeBuiltinOrVarAsType(required); + .computeBuiltinOrVarAsType(required) + ..recovered = true; } } return noType; diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart index 939bcc0e663..099319fa44c 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/type_info_impl.dart @@ -107,6 +107,9 @@ class NoType implements TypeInfo { @override bool get isFunctionType => false; + @override + bool get recovered => false; + @override Token ensureTypeNotVoid(Token token, Parser parser) { parser.reportRecoverableErrorWithToken( @@ -154,6 +157,9 @@ class PrefixedType implements TypeInfo { @override bool get isFunctionType => false; + @override + bool get recovered => false; + @override Token ensureTypeNotVoid(Token token, Parser parser) => parseType(token, parser); @@ -206,6 +212,9 @@ class SimpleNullableTypeWith1Argument extends SimpleTypeWith1Argument { @override bool get isFunctionType => false; + @override + bool get recovered => false; + @override Token parseTypeRest(Token start, Token token, Parser parser) { token = token.next!; @@ -243,6 +252,9 @@ class SimpleTypeWith1Argument implements TypeInfo { @override bool get isFunctionType => false; + @override + bool get recovered => false; + @override Token ensureTypeNotVoid(Token token, Parser parser) => parseType(token, parser); @@ -290,6 +302,9 @@ class SimpleNullableType extends SimpleType { @override bool get isFunctionType => false; + @override + bool get recovered => false; + @override Token parseTypeRest(Token start, Parser parser) { Token token = start.next!; @@ -323,6 +338,9 @@ class SimpleType implements TypeInfo { @override bool get isFunctionType => false; + @override + bool get recovered => false; + @override Token ensureTypeNotVoid(Token token, Parser parser) => parseType(token, parser); @@ -374,6 +392,9 @@ class VoidType implements TypeInfo { @override bool get isFunctionType => false; + @override + bool get recovered => false; + @override Token ensureTypeNotVoid(Token token, Parser parser) { // Report an error, then parse `void` as if it were a type name. @@ -486,21 +507,30 @@ class ComplexTypeInfo implements TypeInfo { /// whether it has a return type, otherwise this is `null`. bool? gftHasReturnType; + @override + bool recovered; + ComplexTypeInfo(Token beforeStart, this.typeArguments) - : this.start = beforeStart.next! { + : this.start = beforeStart.next!, + recovered = typeArguments.recovered { // ignore: unnecessary_null_comparison assert(typeArguments != null); } ComplexTypeInfo._nonNullable(this.start, this.typeArguments, this.end, - this.typeVariableStarters, this.gftHasReturnType); + this.typeVariableStarters, this.gftHasReturnType, this.recovered); @override TypeInfo get asNonNullable { return beforeQuestionMark == null ? this - : new ComplexTypeInfo._nonNullable(start, typeArguments, - beforeQuestionMark, typeVariableStarters, gftHasReturnType); + : new ComplexTypeInfo._nonNullable( + start, + typeArguments, + beforeQuestionMark, + typeVariableStarters, + gftHasReturnType, + recovered); } @override @@ -689,7 +719,7 @@ class ComplexTypeInfo implements TypeInfo { /// Given a builtin, return the receiver so that parseType will report /// an error for the builtin used as a type. - TypeInfo computeBuiltinOrVarAsType(bool required) { + ComplexTypeInfo computeBuiltinOrVarAsType(bool required) { assert(start.type.isBuiltIn || optional('var', start)); end = typeArguments.skip(start); @@ -963,6 +993,7 @@ class ComplexTypeParamOrArgInfo extends TypeParamOrArgInfo { while (true) { TypeInfo typeInfo = computeType(next, /* required = */ true, inDeclaration); + recovered = recovered | typeInfo.recovered; if (typeInfo == noType) { while (typeInfo == noType && optional('@', next.next!)) { next = skipMetadata(next); diff --git a/pkg/front_end/parser_testcases/general/issue_47008_01.dart b/pkg/front_end/parser_testcases/general/issue_47008_01.dart new file mode 100644 index 00000000000..388e5d8f1a5 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_01.dart @@ -0,0 +1,3 @@ +main() { + a(b < c, d < e, 1 >> (2)); +} diff --git a/pkg/front_end/parser_testcases/general/issue_47008_01.dart.expect b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.expect new file mode 100644 index 00000000000..c74a161d866 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.expect @@ -0,0 +1,47 @@ +beginCompilationUnit(main) + beginMetadataStar(main) + endMetadataStar(0) + beginTopLevelMember(main) + beginTopLevelMethod(, null) + handleNoType() + handleIdentifier(main, topLevelFunctionDeclaration) + handleNoTypeVariables(() + beginFormalParameters((, MemberKind.TopLevelMethod) + endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + handleAsyncModifier(null, null) + beginBlockFunctionBody({) + handleIdentifier(a, expression) + handleNoTypeArguments(() + beginArguments(() + handleIdentifier(b, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(b, <) + beginBinaryExpression(<) + handleIdentifier(c, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(c, ,) + endBinaryExpression(<) + handleIdentifier(d, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(d, <) + beginBinaryExpression(<) + handleIdentifier(e, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(e, ,) + endBinaryExpression(<) + handleLiteralInt(1) + beginBinaryExpression(>>) + handleLiteralInt(2) + handleParenthesizedExpression(() + endBinaryExpression(>>) + endArguments(3, (, )) + handleSend(a, ;) + handleExpressionStatement(;) + endBlockFunctionBody(1, {, }) + endTopLevelMethod(main, null, }) + endTopLevelDeclaration() +endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47008_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.intertwined.expect new file mode 100644 index 00000000000..406fe2ca28d --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.intertwined.expect @@ -0,0 +1,137 @@ +parseUnit(main) + skipErrorTokens(main) + listener: beginCompilationUnit(main) + syntheticPreviousToken(main) + parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext') + parseMetadataStar() + listener: beginMetadataStar(main) + listener: endMetadataStar(0) + parseTopLevelMemberImpl() + listener: beginTopLevelMember(main) + isReservedKeyword(() + parseTopLevelMethod(, null, , Instance of 'NoType', null, main, false) + listener: beginTopLevelMethod(, null) + listener: handleNoType() + ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false) + listener: handleIdentifier(main, topLevelFunctionDeclaration) + parseMethodTypeVar(main) + listener: handleNoTypeVariables(() + parseGetterOrFormalParameters(main, main, false, MemberKind.TopLevelMethod) + parseFormalParameters(main, MemberKind.TopLevelMethod) + parseFormalParametersRest((, MemberKind.TopLevelMethod) + listener: beginFormalParameters((, MemberKind.TopLevelMethod) + listener: endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + parseAsyncModifierOpt()) + listener: handleAsyncModifier(null, null) + inPlainSync() + parseFunctionBody(), false, false) + listener: beginBlockFunctionBody({) + notEofOrValue(}, a) + parseStatement({) + parseStatementX({) + parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false) + looksLikeLocalFunction(a) + parseExpressionStatement({) + parseExpression({) + parsePrecedenceExpression({, 1, true) + parseUnaryExpression({, true) + parsePrimary({, expression) + parseSendOrFunctionLiteral({, expression) + looksLikeFunctionBody(;) + parseSend({, expression) + isNextIdentifier({) + ensureIdentifier({, expression) + listener: handleIdentifier(a, expression) + listener: handleNoTypeArguments(() + parseArgumentsOpt(a) + parseArguments(a) + parseArgumentsRest(() + listener: beginArguments(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseSendOrFunctionLiteral((, expression) + looksLikeFunctionBody()) + parseSend((, expression) + isNextIdentifier(() + ensureIdentifier((, expression) + listener: handleIdentifier(b, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(b) + listener: handleNoArguments(<) + listener: handleSend(b, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(c, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(c) + listener: handleNoArguments(,) + listener: handleSend(c, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + parseSendOrFunctionLiteral(,, expression) + parseSend(,, expression) + isNextIdentifier(,) + ensureIdentifier(,, expression) + listener: handleIdentifier(d, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(d) + listener: handleNoArguments(<) + listener: handleSend(d, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(e, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(e) + listener: handleNoArguments(,) + listener: handleSend(e, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + parseLiteralInt(,) + listener: handleLiteralInt(1) + listener: beginBinaryExpression(>>) + parsePrecedenceExpression(>>, 13, true) + parseUnaryExpression(>>, true) + parsePrimary(>>, expression) + parseParenthesizedExpressionOrFunctionLiteral(>>) + parseParenthesizedExpression(>>) + parseExpressionInParenthesis(>>) + parseExpressionInParenthesisRest(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseLiteralInt(() + listener: handleLiteralInt(2) + ensureCloseParen(2, () + listener: handleParenthesizedExpression(() + listener: endBinaryExpression(>>) + listener: endArguments(3, (, )) + listener: handleSend(a, ;) + ensureSemicolon()) + listener: handleExpressionStatement(;) + notEofOrValue(}, }) + listener: endBlockFunctionBody(1, {, }) + listener: endTopLevelMethod(main, null, }) + listener: endTopLevelDeclaration() + reportAllErrorTokens(main) + listener: endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47008_01.dart.parser.expect b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.parser.expect new file mode 100644 index 00000000000..f090739631b --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.parser.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, d < e, 1 >> (2)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] d[StringToken] <[BeginToken] e[StringToken],[SimpleToken] 1[StringToken] >>[SimpleToken] ([BeginToken]2[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/parser_testcases/general/issue_47008_01.dart.scanner.expect b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.scanner.expect new file mode 100644 index 00000000000..f090739631b --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_01.dart.scanner.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, d < e, 1 >> (2)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] d[StringToken] <[BeginToken] e[StringToken],[SimpleToken] 1[StringToken] >>[SimpleToken] ([BeginToken]2[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/parser_testcases/general/issue_47008_02.dart b/pkg/front_end/parser_testcases/general/issue_47008_02.dart new file mode 100644 index 00000000000..33c62b65386 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_02.dart @@ -0,0 +1,3 @@ +main() { + a(b < c, d < e, f < g, 1 >>> (2)); +} diff --git a/pkg/front_end/parser_testcases/general/issue_47008_02.dart.expect b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.expect new file mode 100644 index 00000000000..f0770d5ea29 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.expect @@ -0,0 +1,57 @@ +beginCompilationUnit(main) + beginMetadataStar(main) + endMetadataStar(0) + beginTopLevelMember(main) + beginTopLevelMethod(, null) + handleNoType() + handleIdentifier(main, topLevelFunctionDeclaration) + handleNoTypeVariables(() + beginFormalParameters((, MemberKind.TopLevelMethod) + endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + handleAsyncModifier(null, null) + beginBlockFunctionBody({) + handleIdentifier(a, expression) + handleNoTypeArguments(() + beginArguments(() + handleIdentifier(b, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(b, <) + beginBinaryExpression(<) + handleIdentifier(c, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(c, ,) + endBinaryExpression(<) + handleIdentifier(d, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(d, <) + beginBinaryExpression(<) + handleIdentifier(e, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(e, ,) + endBinaryExpression(<) + handleIdentifier(f, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(f, <) + beginBinaryExpression(<) + handleIdentifier(g, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(g, ,) + endBinaryExpression(<) + handleLiteralInt(1) + beginBinaryExpression(>>>) + handleLiteralInt(2) + handleParenthesizedExpression(() + endBinaryExpression(>>>) + endArguments(4, (, )) + handleSend(a, ;) + handleExpressionStatement(;) + endBlockFunctionBody(1, {, }) + endTopLevelMethod(main, null, }) + endTopLevelDeclaration() +endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47008_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.intertwined.expect new file mode 100644 index 00000000000..4f3fe74e590 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.intertwined.expect @@ -0,0 +1,164 @@ +parseUnit(main) + skipErrorTokens(main) + listener: beginCompilationUnit(main) + syntheticPreviousToken(main) + parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext') + parseMetadataStar() + listener: beginMetadataStar(main) + listener: endMetadataStar(0) + parseTopLevelMemberImpl() + listener: beginTopLevelMember(main) + isReservedKeyword(() + parseTopLevelMethod(, null, , Instance of 'NoType', null, main, false) + listener: beginTopLevelMethod(, null) + listener: handleNoType() + ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false) + listener: handleIdentifier(main, topLevelFunctionDeclaration) + parseMethodTypeVar(main) + listener: handleNoTypeVariables(() + parseGetterOrFormalParameters(main, main, false, MemberKind.TopLevelMethod) + parseFormalParameters(main, MemberKind.TopLevelMethod) + parseFormalParametersRest((, MemberKind.TopLevelMethod) + listener: beginFormalParameters((, MemberKind.TopLevelMethod) + listener: endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + parseAsyncModifierOpt()) + listener: handleAsyncModifier(null, null) + inPlainSync() + parseFunctionBody(), false, false) + listener: beginBlockFunctionBody({) + notEofOrValue(}, a) + parseStatement({) + parseStatementX({) + parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false) + looksLikeLocalFunction(a) + parseExpressionStatement({) + parseExpression({) + parsePrecedenceExpression({, 1, true) + parseUnaryExpression({, true) + parsePrimary({, expression) + parseSendOrFunctionLiteral({, expression) + looksLikeFunctionBody(;) + parseSend({, expression) + isNextIdentifier({) + ensureIdentifier({, expression) + listener: handleIdentifier(a, expression) + listener: handleNoTypeArguments(() + parseArgumentsOpt(a) + parseArguments(a) + parseArgumentsRest(() + listener: beginArguments(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseSendOrFunctionLiteral((, expression) + looksLikeFunctionBody()) + parseSend((, expression) + isNextIdentifier(() + ensureIdentifier((, expression) + listener: handleIdentifier(b, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(b) + listener: handleNoArguments(<) + listener: handleSend(b, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(c, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(c) + listener: handleNoArguments(,) + listener: handleSend(c, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + parseSendOrFunctionLiteral(,, expression) + parseSend(,, expression) + isNextIdentifier(,) + ensureIdentifier(,, expression) + listener: handleIdentifier(d, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(d) + listener: handleNoArguments(<) + listener: handleSend(d, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(e, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(e) + listener: handleNoArguments(,) + listener: handleSend(e, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + parseSendOrFunctionLiteral(,, expression) + parseSend(,, expression) + isNextIdentifier(,) + ensureIdentifier(,, expression) + listener: handleIdentifier(f, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(f) + listener: handleNoArguments(<) + listener: handleSend(f, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(g, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(g) + listener: handleNoArguments(,) + listener: handleSend(g, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + parseLiteralInt(,) + listener: handleLiteralInt(1) + listener: beginBinaryExpression(>>>) + parsePrecedenceExpression(>>>, 13, true) + parseUnaryExpression(>>>, true) + parsePrimary(>>>, expression) + parseParenthesizedExpressionOrFunctionLiteral(>>>) + parseParenthesizedExpression(>>>) + parseExpressionInParenthesis(>>>) + parseExpressionInParenthesisRest(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseLiteralInt(() + listener: handleLiteralInt(2) + ensureCloseParen(2, () + listener: handleParenthesizedExpression(() + listener: endBinaryExpression(>>>) + listener: endArguments(4, (, )) + listener: handleSend(a, ;) + ensureSemicolon()) + listener: handleExpressionStatement(;) + notEofOrValue(}, }) + listener: endBlockFunctionBody(1, {, }) + listener: endTopLevelMethod(main, null, }) + listener: endTopLevelDeclaration() + reportAllErrorTokens(main) + listener: endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47008_02.dart.parser.expect b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.parser.expect new file mode 100644 index 00000000000..0e53edf1868 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.parser.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, d < e, f < g, 1 >>> (2)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] d[StringToken] <[BeginToken] e[StringToken],[SimpleToken] f[StringToken] <[BeginToken] g[StringToken],[SimpleToken] 1[StringToken] >>>[SimpleToken] ([BeginToken]2[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/parser_testcases/general/issue_47008_02.dart.scanner.expect b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.scanner.expect new file mode 100644 index 00000000000..0e53edf1868 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47008_02.dart.scanner.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, d < e, f < g, 1 >>> (2)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] d[StringToken] <[BeginToken] e[StringToken],[SimpleToken] f[StringToken] <[BeginToken] g[StringToken],[SimpleToken] 1[StringToken] >>>[SimpleToken] ([BeginToken]2[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/parser_testcases/general/issue_47009_01.dart b/pkg/front_end/parser_testcases/general/issue_47009_01.dart new file mode 100644 index 00000000000..87237b99224 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_01.dart @@ -0,0 +1,3 @@ +main() { + a(b < c, as > (1)); +} diff --git a/pkg/front_end/parser_testcases/general/issue_47009_01.dart.expect b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.expect new file mode 100644 index 00000000000..5e09e8f4482 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.expect @@ -0,0 +1,40 @@ +beginCompilationUnit(main) + beginMetadataStar(main) + endMetadataStar(0) + beginTopLevelMember(main) + beginTopLevelMethod(, null) + handleNoType() + handleIdentifier(main, topLevelFunctionDeclaration) + handleNoTypeVariables(() + beginFormalParameters((, MemberKind.TopLevelMethod) + endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + handleAsyncModifier(null, null) + beginBlockFunctionBody({) + handleIdentifier(a, expression) + handleNoTypeArguments(() + beginArguments(() + handleIdentifier(b, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(b, <) + beginBinaryExpression(<) + handleIdentifier(c, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(c, ,) + endBinaryExpression(<) + handleIdentifier(as, expression) + handleNoTypeArguments(>) + handleNoArguments(>) + handleSend(as, >) + beginBinaryExpression(>) + handleLiteralInt(1) + handleParenthesizedExpression(() + endBinaryExpression(>) + endArguments(2, (, )) + handleSend(a, ;) + handleExpressionStatement(;) + endBlockFunctionBody(1, {, }) + endTopLevelMethod(main, null, }) + endTopLevelDeclaration() +endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47009_01.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.intertwined.expect new file mode 100644 index 00000000000..1876a123673 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.intertwined.expect @@ -0,0 +1,119 @@ +parseUnit(main) + skipErrorTokens(main) + listener: beginCompilationUnit(main) + syntheticPreviousToken(main) + parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext') + parseMetadataStar() + listener: beginMetadataStar(main) + listener: endMetadataStar(0) + parseTopLevelMemberImpl() + listener: beginTopLevelMember(main) + isReservedKeyword(() + parseTopLevelMethod(, null, , Instance of 'NoType', null, main, false) + listener: beginTopLevelMethod(, null) + listener: handleNoType() + ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false) + listener: handleIdentifier(main, topLevelFunctionDeclaration) + parseMethodTypeVar(main) + listener: handleNoTypeVariables(() + parseGetterOrFormalParameters(main, main, false, MemberKind.TopLevelMethod) + parseFormalParameters(main, MemberKind.TopLevelMethod) + parseFormalParametersRest((, MemberKind.TopLevelMethod) + listener: beginFormalParameters((, MemberKind.TopLevelMethod) + listener: endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + parseAsyncModifierOpt()) + listener: handleAsyncModifier(null, null) + inPlainSync() + parseFunctionBody(), false, false) + listener: beginBlockFunctionBody({) + notEofOrValue(}, a) + parseStatement({) + parseStatementX({) + parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false) + looksLikeLocalFunction(a) + parseExpressionStatement({) + parseExpression({) + parsePrecedenceExpression({, 1, true) + parseUnaryExpression({, true) + parsePrimary({, expression) + parseSendOrFunctionLiteral({, expression) + looksLikeFunctionBody(;) + parseSend({, expression) + isNextIdentifier({) + ensureIdentifier({, expression) + listener: handleIdentifier(a, expression) + listener: handleNoTypeArguments(() + parseArgumentsOpt(a) + parseArguments(a) + parseArgumentsRest(() + listener: beginArguments(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseSendOrFunctionLiteral((, expression) + looksLikeFunctionBody()) + parseSend((, expression) + isNextIdentifier(() + ensureIdentifier((, expression) + listener: handleIdentifier(b, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(b) + listener: handleNoArguments(<) + listener: handleSend(b, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(c, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(c) + listener: handleNoArguments(,) + listener: handleSend(c, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + inPlainSync() + parseSendOrFunctionLiteral(,, expression) + parseSend(,, expression) + isNextIdentifier(,) + ensureIdentifier(,, expression) + inPlainSync() + listener: handleIdentifier(as, expression) + listener: handleNoTypeArguments(>) + parseArgumentsOpt(as) + listener: handleNoArguments(>) + listener: handleSend(as, >) + listener: beginBinaryExpression(>) + parsePrecedenceExpression(>, 9, true) + parseUnaryExpression(>, true) + parsePrimary(>, expression) + parseParenthesizedExpressionOrFunctionLiteral(>) + parseParenthesizedExpression(>) + parseExpressionInParenthesis(>) + parseExpressionInParenthesisRest(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseLiteralInt(() + listener: handleLiteralInt(1) + ensureCloseParen(1, () + listener: handleParenthesizedExpression(() + listener: endBinaryExpression(>) + listener: endArguments(2, (, )) + listener: handleSend(a, ;) + ensureSemicolon()) + listener: handleExpressionStatement(;) + notEofOrValue(}, }) + listener: endBlockFunctionBody(1, {, }) + listener: endTopLevelMethod(main, null, }) + listener: endTopLevelDeclaration() + reportAllErrorTokens(main) + listener: endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47009_01.dart.parser.expect b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.parser.expect new file mode 100644 index 00000000000..712e62b2351 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.parser.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, as > (1)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] as[KeywordToken] >[SimpleToken] ([BeginToken]1[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/parser_testcases/general/issue_47009_01.dart.scanner.expect b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.scanner.expect new file mode 100644 index 00000000000..712e62b2351 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_01.dart.scanner.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, as > (1)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] as[KeywordToken] >[SimpleToken] ([BeginToken]1[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/parser_testcases/general/issue_47009_02.dart b/pkg/front_end/parser_testcases/general/issue_47009_02.dart new file mode 100644 index 00000000000..3d20a333e93 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_02.dart @@ -0,0 +1,3 @@ +main() { + a(b < c, d < e, as >> (1)); +} diff --git a/pkg/front_end/parser_testcases/general/issue_47009_02.dart.expect b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.expect new file mode 100644 index 00000000000..a4e036984aa --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.expect @@ -0,0 +1,50 @@ +beginCompilationUnit(main) + beginMetadataStar(main) + endMetadataStar(0) + beginTopLevelMember(main) + beginTopLevelMethod(, null) + handleNoType() + handleIdentifier(main, topLevelFunctionDeclaration) + handleNoTypeVariables(() + beginFormalParameters((, MemberKind.TopLevelMethod) + endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + handleAsyncModifier(null, null) + beginBlockFunctionBody({) + handleIdentifier(a, expression) + handleNoTypeArguments(() + beginArguments(() + handleIdentifier(b, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(b, <) + beginBinaryExpression(<) + handleIdentifier(c, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(c, ,) + endBinaryExpression(<) + handleIdentifier(d, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(d, <) + beginBinaryExpression(<) + handleIdentifier(e, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(e, ,) + endBinaryExpression(<) + handleIdentifier(as, expression) + handleNoTypeArguments(>>) + handleNoArguments(>>) + handleSend(as, >>) + beginBinaryExpression(>>) + handleLiteralInt(1) + handleParenthesizedExpression(() + endBinaryExpression(>>) + endArguments(3, (, )) + handleSend(a, ;) + handleExpressionStatement(;) + endBlockFunctionBody(1, {, }) + endTopLevelMethod(main, null, }) + endTopLevelDeclaration() +endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47009_02.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.intertwined.expect new file mode 100644 index 00000000000..91cb220ea2d --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.intertwined.expect @@ -0,0 +1,146 @@ +parseUnit(main) + skipErrorTokens(main) + listener: beginCompilationUnit(main) + syntheticPreviousToken(main) + parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext') + parseMetadataStar() + listener: beginMetadataStar(main) + listener: endMetadataStar(0) + parseTopLevelMemberImpl() + listener: beginTopLevelMember(main) + isReservedKeyword(() + parseTopLevelMethod(, null, , Instance of 'NoType', null, main, false) + listener: beginTopLevelMethod(, null) + listener: handleNoType() + ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false) + listener: handleIdentifier(main, topLevelFunctionDeclaration) + parseMethodTypeVar(main) + listener: handleNoTypeVariables(() + parseGetterOrFormalParameters(main, main, false, MemberKind.TopLevelMethod) + parseFormalParameters(main, MemberKind.TopLevelMethod) + parseFormalParametersRest((, MemberKind.TopLevelMethod) + listener: beginFormalParameters((, MemberKind.TopLevelMethod) + listener: endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + parseAsyncModifierOpt()) + listener: handleAsyncModifier(null, null) + inPlainSync() + parseFunctionBody(), false, false) + listener: beginBlockFunctionBody({) + notEofOrValue(}, a) + parseStatement({) + parseStatementX({) + parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false) + looksLikeLocalFunction(a) + parseExpressionStatement({) + parseExpression({) + parsePrecedenceExpression({, 1, true) + parseUnaryExpression({, true) + parsePrimary({, expression) + parseSendOrFunctionLiteral({, expression) + looksLikeFunctionBody(;) + parseSend({, expression) + isNextIdentifier({) + ensureIdentifier({, expression) + listener: handleIdentifier(a, expression) + listener: handleNoTypeArguments(() + parseArgumentsOpt(a) + parseArguments(a) + parseArgumentsRest(() + listener: beginArguments(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseSendOrFunctionLiteral((, expression) + looksLikeFunctionBody()) + parseSend((, expression) + isNextIdentifier(() + ensureIdentifier((, expression) + listener: handleIdentifier(b, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(b) + listener: handleNoArguments(<) + listener: handleSend(b, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(c, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(c) + listener: handleNoArguments(,) + listener: handleSend(c, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + parseSendOrFunctionLiteral(,, expression) + parseSend(,, expression) + isNextIdentifier(,) + ensureIdentifier(,, expression) + listener: handleIdentifier(d, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(d) + listener: handleNoArguments(<) + listener: handleSend(d, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(e, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(e) + listener: handleNoArguments(,) + listener: handleSend(e, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + inPlainSync() + parseSendOrFunctionLiteral(,, expression) + parseSend(,, expression) + isNextIdentifier(,) + ensureIdentifier(,, expression) + inPlainSync() + listener: handleIdentifier(as, expression) + listener: handleNoTypeArguments(>>) + parseArgumentsOpt(as) + listener: handleNoArguments(>>) + listener: handleSend(as, >>) + listener: beginBinaryExpression(>>) + parsePrecedenceExpression(>>, 13, true) + parseUnaryExpression(>>, true) + parsePrimary(>>, expression) + parseParenthesizedExpressionOrFunctionLiteral(>>) + parseParenthesizedExpression(>>) + parseExpressionInParenthesis(>>) + parseExpressionInParenthesisRest(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseLiteralInt(() + listener: handleLiteralInt(1) + ensureCloseParen(1, () + listener: handleParenthesizedExpression(() + listener: endBinaryExpression(>>) + listener: endArguments(3, (, )) + listener: handleSend(a, ;) + ensureSemicolon()) + listener: handleExpressionStatement(;) + notEofOrValue(}, }) + listener: endBlockFunctionBody(1, {, }) + listener: endTopLevelMethod(main, null, }) + listener: endTopLevelDeclaration() + reportAllErrorTokens(main) + listener: endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47009_02.dart.parser.expect b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.parser.expect new file mode 100644 index 00000000000..1e4544c4cef --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.parser.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, d < e, as >> (1)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] d[StringToken] <[BeginToken] e[StringToken],[SimpleToken] as[KeywordToken] >>[SimpleToken] ([BeginToken]1[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/parser_testcases/general/issue_47009_02.dart.scanner.expect b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.scanner.expect new file mode 100644 index 00000000000..1e4544c4cef --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_02.dart.scanner.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, d < e, as >> (1)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] d[StringToken] <[BeginToken] e[StringToken],[SimpleToken] as[KeywordToken] >>[SimpleToken] ([BeginToken]1[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/parser_testcases/general/issue_47009_03.dart b/pkg/front_end/parser_testcases/general/issue_47009_03.dart new file mode 100644 index 00000000000..8479533619c --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_03.dart @@ -0,0 +1,3 @@ +main() { + a(b < c, d < e, f < g, as >>> (1)); +} diff --git a/pkg/front_end/parser_testcases/general/issue_47009_03.dart.expect b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.expect new file mode 100644 index 00000000000..1170055ce20 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.expect @@ -0,0 +1,60 @@ +beginCompilationUnit(main) + beginMetadataStar(main) + endMetadataStar(0) + beginTopLevelMember(main) + beginTopLevelMethod(, null) + handleNoType() + handleIdentifier(main, topLevelFunctionDeclaration) + handleNoTypeVariables(() + beginFormalParameters((, MemberKind.TopLevelMethod) + endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + handleAsyncModifier(null, null) + beginBlockFunctionBody({) + handleIdentifier(a, expression) + handleNoTypeArguments(() + beginArguments(() + handleIdentifier(b, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(b, <) + beginBinaryExpression(<) + handleIdentifier(c, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(c, ,) + endBinaryExpression(<) + handleIdentifier(d, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(d, <) + beginBinaryExpression(<) + handleIdentifier(e, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(e, ,) + endBinaryExpression(<) + handleIdentifier(f, expression) + handleNoTypeArguments(<) + handleNoArguments(<) + handleSend(f, <) + beginBinaryExpression(<) + handleIdentifier(g, expression) + handleNoTypeArguments(,) + handleNoArguments(,) + handleSend(g, ,) + endBinaryExpression(<) + handleIdentifier(as, expression) + handleNoTypeArguments(>>>) + handleNoArguments(>>>) + handleSend(as, >>>) + beginBinaryExpression(>>>) + handleLiteralInt(1) + handleParenthesizedExpression(() + endBinaryExpression(>>>) + endArguments(4, (, )) + handleSend(a, ;) + handleExpressionStatement(;) + endBlockFunctionBody(1, {, }) + endTopLevelMethod(main, null, }) + endTopLevelDeclaration() +endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47009_03.dart.intertwined.expect b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.intertwined.expect new file mode 100644 index 00000000000..d6851081b79 --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.intertwined.expect @@ -0,0 +1,173 @@ +parseUnit(main) + skipErrorTokens(main) + listener: beginCompilationUnit(main) + syntheticPreviousToken(main) + parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext') + parseMetadataStar() + listener: beginMetadataStar(main) + listener: endMetadataStar(0) + parseTopLevelMemberImpl() + listener: beginTopLevelMember(main) + isReservedKeyword(() + parseTopLevelMethod(, null, , Instance of 'NoType', null, main, false) + listener: beginTopLevelMethod(, null) + listener: handleNoType() + ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false) + listener: handleIdentifier(main, topLevelFunctionDeclaration) + parseMethodTypeVar(main) + listener: handleNoTypeVariables(() + parseGetterOrFormalParameters(main, main, false, MemberKind.TopLevelMethod) + parseFormalParameters(main, MemberKind.TopLevelMethod) + parseFormalParametersRest((, MemberKind.TopLevelMethod) + listener: beginFormalParameters((, MemberKind.TopLevelMethod) + listener: endFormalParameters(0, (, ), MemberKind.TopLevelMethod) + parseAsyncModifierOpt()) + listener: handleAsyncModifier(null, null) + inPlainSync() + parseFunctionBody(), false, false) + listener: beginBlockFunctionBody({) + notEofOrValue(}, a) + parseStatement({) + parseStatementX({) + parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false) + looksLikeLocalFunction(a) + parseExpressionStatement({) + parseExpression({) + parsePrecedenceExpression({, 1, true) + parseUnaryExpression({, true) + parsePrimary({, expression) + parseSendOrFunctionLiteral({, expression) + looksLikeFunctionBody(;) + parseSend({, expression) + isNextIdentifier({) + ensureIdentifier({, expression) + listener: handleIdentifier(a, expression) + listener: handleNoTypeArguments(() + parseArgumentsOpt(a) + parseArguments(a) + parseArgumentsRest(() + listener: beginArguments(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseSendOrFunctionLiteral((, expression) + looksLikeFunctionBody()) + parseSend((, expression) + isNextIdentifier(() + ensureIdentifier((, expression) + listener: handleIdentifier(b, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(b) + listener: handleNoArguments(<) + listener: handleSend(b, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(c, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(c) + listener: handleNoArguments(,) + listener: handleSend(c, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + parseSendOrFunctionLiteral(,, expression) + parseSend(,, expression) + isNextIdentifier(,) + ensureIdentifier(,, expression) + listener: handleIdentifier(d, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(d) + listener: handleNoArguments(<) + listener: handleSend(d, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(e, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(e) + listener: handleNoArguments(,) + listener: handleSend(e, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + parseSendOrFunctionLiteral(,, expression) + parseSend(,, expression) + isNextIdentifier(,) + ensureIdentifier(,, expression) + listener: handleIdentifier(f, expression) + listener: handleNoTypeArguments(<) + parseArgumentsOpt(f) + listener: handleNoArguments(<) + listener: handleSend(f, <) + listener: beginBinaryExpression(<) + parsePrecedenceExpression(<, 9, true) + parseUnaryExpression(<, true) + parsePrimary(<, expression) + parseSendOrFunctionLiteral(<, expression) + parseSend(<, expression) + isNextIdentifier(<) + ensureIdentifier(<, expression) + listener: handleIdentifier(g, expression) + listener: handleNoTypeArguments(,) + parseArgumentsOpt(g) + listener: handleNoArguments(,) + listener: handleSend(g, ,) + listener: endBinaryExpression(<) + parseExpression(,) + parsePrecedenceExpression(,, 1, true) + parseUnaryExpression(,, true) + parsePrimary(,, expression) + inPlainSync() + parseSendOrFunctionLiteral(,, expression) + parseSend(,, expression) + isNextIdentifier(,) + ensureIdentifier(,, expression) + inPlainSync() + listener: handleIdentifier(as, expression) + listener: handleNoTypeArguments(>>>) + parseArgumentsOpt(as) + listener: handleNoArguments(>>>) + listener: handleSend(as, >>>) + listener: beginBinaryExpression(>>>) + parsePrecedenceExpression(>>>, 13, true) + parseUnaryExpression(>>>, true) + parsePrimary(>>>, expression) + parseParenthesizedExpressionOrFunctionLiteral(>>>) + parseParenthesizedExpression(>>>) + parseExpressionInParenthesis(>>>) + parseExpressionInParenthesisRest(() + parseExpression(() + parsePrecedenceExpression((, 1, true) + parseUnaryExpression((, true) + parsePrimary((, expression) + parseLiteralInt(() + listener: handleLiteralInt(1) + ensureCloseParen(1, () + listener: handleParenthesizedExpression(() + listener: endBinaryExpression(>>>) + listener: endArguments(4, (, )) + listener: handleSend(a, ;) + ensureSemicolon()) + listener: handleExpressionStatement(;) + notEofOrValue(}, }) + listener: endBlockFunctionBody(1, {, }) + listener: endTopLevelMethod(main, null, }) + listener: endTopLevelDeclaration() + reportAllErrorTokens(main) + listener: endCompilationUnit(1, ) diff --git a/pkg/front_end/parser_testcases/general/issue_47009_03.dart.parser.expect b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.parser.expect new file mode 100644 index 00000000000..1fbc7ffc0db --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.parser.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, d < e, f < g, as >>> (1)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] d[StringToken] <[BeginToken] e[StringToken],[SimpleToken] f[StringToken] <[BeginToken] g[StringToken],[SimpleToken] as[KeywordToken] >>>[SimpleToken] ([BeginToken]1[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/parser_testcases/general/issue_47009_03.dart.scanner.expect b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.scanner.expect new file mode 100644 index 00000000000..1fbc7ffc0db --- /dev/null +++ b/pkg/front_end/parser_testcases/general/issue_47009_03.dart.scanner.expect @@ -0,0 +1,9 @@ +main() { +a(b < c, d < e, f < g, as >>> (1)); +} + + +main[StringToken]([BeginToken])[SimpleToken] {[BeginToken] +a[StringToken]([BeginToken]b[StringToken] <[BeginToken] c[StringToken],[SimpleToken] d[StringToken] <[BeginToken] e[StringToken],[SimpleToken] f[StringToken] <[BeginToken] g[StringToken],[SimpleToken] as[KeywordToken] >>>[SimpleToken] ([BeginToken]1[StringToken])[SimpleToken])[SimpleToken];[SimpleToken] +}[SimpleToken] +[SimpleToken] diff --git a/pkg/front_end/testcases/general/issue_47008_01.dart b/pkg/front_end/testcases/general/issue_47008_01.dart new file mode 100644 index 00000000000..7980b2eb91b --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_01.dart @@ -0,0 +1,11 @@ +main() { + int b = 1; + int c = 2; + int d = 3; + int e = 4; + a(b < c, d < e, 1 >> (2)); +} + +void a(bool x, bool y, int z) { + print("$x $y $z"); +} \ No newline at end of file diff --git a/pkg/front_end/testcases/general/issue_47008_01.dart.textual_outline.expect b/pkg/front_end/testcases/general/issue_47008_01.dart.textual_outline.expect new file mode 100644 index 00000000000..c8a6141d1fb --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_01.dart.textual_outline.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y, int z) {} diff --git a/pkg/front_end/testcases/general/issue_47008_01.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/issue_47008_01.dart.textual_outline_modelled.expect new file mode 100644 index 00000000000..c8a6141d1fb --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_01.dart.textual_outline_modelled.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y, int z) {} diff --git a/pkg/front_end/testcases/general/issue_47008_01.dart.weak.expect b/pkg/front_end/testcases/general/issue_47008_01.dart.weak.expect new file mode 100644 index 00000000000..383dfab6c37 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_01.dart.weak.expect @@ -0,0 +1,14 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int d = 3; + core::int e = 4; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, d.{core::num::<}(e){(core::num) → core::bool}, 1.{core::int::>>}(2){(core::int) → core::int}); +} +static method a(core::bool x, core::bool y, core::int z) → void { + core::print("${x} ${y} ${z}"); +} diff --git a/pkg/front_end/testcases/general/issue_47008_01.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue_47008_01.dart.weak.outline.expect new file mode 100644 index 00000000000..35353cd2b37 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_01.dart.weak.outline.expect @@ -0,0 +1,8 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic + ; +static method a(core::bool x, core::bool y, core::int z) → void + ; diff --git a/pkg/front_end/testcases/general/issue_47008_01.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue_47008_01.dart.weak.transformed.expect new file mode 100644 index 00000000000..54bfd70d84c --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_01.dart.weak.transformed.expect @@ -0,0 +1,19 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int d = 3; + core::int e = 4; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, d.{core::num::<}(e){(core::num) → core::bool}, 1.{core::int::>>}(2){(core::int) → core::int}); +} +static method a(core::bool x, core::bool y, core::int z) → void { + core::print("${x} ${y} ${z}"); +} + + +Extra constant evaluation status: +Evaluated: InstanceInvocation @ org-dartlang-testcase:///issue_47008_01.dart:6:21 -> IntConstant(0) +Extra constant evaluation: evaluated: 13, effectively constant: 1 diff --git a/pkg/front_end/testcases/general/issue_47008_02.dart b/pkg/front_end/testcases/general/issue_47008_02.dart new file mode 100644 index 00000000000..996590a37cd --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_02.dart @@ -0,0 +1,13 @@ +main() { + int b = 1; + int c = 2; + int d = 3; + int e = 4; + int f = 5; + int g = 6; + a(b < c, d < e, f < g, 1 >>> (2)); +} + +void a(bool x, bool y, bool z1, int z2) { + print("$x $y $z1 $z2"); +} \ No newline at end of file diff --git a/pkg/front_end/testcases/general/issue_47008_02.dart.textual_outline.expect b/pkg/front_end/testcases/general/issue_47008_02.dart.textual_outline.expect new file mode 100644 index 00000000000..3f2b123a262 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_02.dart.textual_outline.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y, bool z1, int z2) {} diff --git a/pkg/front_end/testcases/general/issue_47008_02.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/issue_47008_02.dart.textual_outline_modelled.expect new file mode 100644 index 00000000000..3f2b123a262 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_02.dart.textual_outline_modelled.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y, bool z1, int z2) {} diff --git a/pkg/front_end/testcases/general/issue_47008_02.dart.weak.expect b/pkg/front_end/testcases/general/issue_47008_02.dart.weak.expect new file mode 100644 index 00000000000..d4483132a7b --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_02.dart.weak.expect @@ -0,0 +1,16 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int d = 3; + core::int e = 4; + core::int f = 5; + core::int g = 6; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, d.{core::num::<}(e){(core::num) → core::bool}, f.{core::num::<}(g){(core::num) → core::bool}, 1.{core::int::>>>}(2){(core::int) → core::int}); +} +static method a(core::bool x, core::bool y, core::bool z1, core::int z2) → void { + core::print("${x} ${y} ${z1} ${z2}"); +} diff --git a/pkg/front_end/testcases/general/issue_47008_02.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue_47008_02.dart.weak.outline.expect new file mode 100644 index 00000000000..b349da92227 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_02.dart.weak.outline.expect @@ -0,0 +1,8 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic + ; +static method a(core::bool x, core::bool y, core::bool z1, core::int z2) → void + ; diff --git a/pkg/front_end/testcases/general/issue_47008_02.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue_47008_02.dart.weak.transformed.expect new file mode 100644 index 00000000000..bc7f96ad6be --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47008_02.dart.weak.transformed.expect @@ -0,0 +1,21 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int d = 3; + core::int e = 4; + core::int f = 5; + core::int g = 6; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, d.{core::num::<}(e){(core::num) → core::bool}, f.{core::num::<}(g){(core::num) → core::bool}, 1.{core::int::>>>}(2){(core::int) → core::int}); +} +static method a(core::bool x, core::bool y, core::bool z1, core::int z2) → void { + core::print("${x} ${y} ${z1} ${z2}"); +} + + +Extra constant evaluation status: +Evaluated: InstanceInvocation @ org-dartlang-testcase:///issue_47008_02.dart:8:28 -> IntConstant(0) +Extra constant evaluation: evaluated: 17, effectively constant: 1 diff --git a/pkg/front_end/testcases/general/issue_47009_01.dart b/pkg/front_end/testcases/general/issue_47009_01.dart new file mode 100644 index 00000000000..127b5fb6b74 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_01.dart @@ -0,0 +1,10 @@ +main() { + int b = 1; + int c = 2; + int as = 3; + a(b < c, as > (1)); +} + +void a(bool x, bool y) { + print("$x $y"); +} \ No newline at end of file diff --git a/pkg/front_end/testcases/general/issue_47009_01.dart.textual_outline.expect b/pkg/front_end/testcases/general/issue_47009_01.dart.textual_outline.expect new file mode 100644 index 00000000000..8c1c1ad5bfb --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_01.dart.textual_outline.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y) {} diff --git a/pkg/front_end/testcases/general/issue_47009_01.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/issue_47009_01.dart.textual_outline_modelled.expect new file mode 100644 index 00000000000..8c1c1ad5bfb --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_01.dart.textual_outline_modelled.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y) {} diff --git a/pkg/front_end/testcases/general/issue_47009_01.dart.weak.expect b/pkg/front_end/testcases/general/issue_47009_01.dart.weak.expect new file mode 100644 index 00000000000..a9de6747bce --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_01.dart.weak.expect @@ -0,0 +1,13 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int as = 3; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, as.{core::num::>}(1){(core::num) → core::bool}); +} +static method a(core::bool x, core::bool y) → void { + core::print("${x} ${y}"); +} diff --git a/pkg/front_end/testcases/general/issue_47009_01.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue_47009_01.dart.weak.outline.expect new file mode 100644 index 00000000000..1e4d67bde9a --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_01.dart.weak.outline.expect @@ -0,0 +1,8 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic + ; +static method a(core::bool x, core::bool y) → void + ; diff --git a/pkg/front_end/testcases/general/issue_47009_01.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue_47009_01.dart.weak.transformed.expect new file mode 100644 index 00000000000..a9de6747bce --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_01.dart.weak.transformed.expect @@ -0,0 +1,13 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int as = 3; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, as.{core::num::>}(1){(core::num) → core::bool}); +} +static method a(core::bool x, core::bool y) → void { + core::print("${x} ${y}"); +} diff --git a/pkg/front_end/testcases/general/issue_47009_02.dart b/pkg/front_end/testcases/general/issue_47009_02.dart new file mode 100644 index 00000000000..fc8dd123cab --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_02.dart @@ -0,0 +1,12 @@ +main() { + int b = 1; + int c = 2; + int d = 3; + int e = 4; + int as = 5; + a(b < c, d < e, as >> (1)); +} + +void a(bool x, bool y, int z) { + print("$x $y $z"); +} \ No newline at end of file diff --git a/pkg/front_end/testcases/general/issue_47009_02.dart.textual_outline.expect b/pkg/front_end/testcases/general/issue_47009_02.dart.textual_outline.expect new file mode 100644 index 00000000000..c8a6141d1fb --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_02.dart.textual_outline.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y, int z) {} diff --git a/pkg/front_end/testcases/general/issue_47009_02.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/issue_47009_02.dart.textual_outline_modelled.expect new file mode 100644 index 00000000000..c8a6141d1fb --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_02.dart.textual_outline_modelled.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y, int z) {} diff --git a/pkg/front_end/testcases/general/issue_47009_02.dart.weak.expect b/pkg/front_end/testcases/general/issue_47009_02.dart.weak.expect new file mode 100644 index 00000000000..c5218bb98ed --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_02.dart.weak.expect @@ -0,0 +1,15 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int d = 3; + core::int e = 4; + core::int as = 5; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, d.{core::num::<}(e){(core::num) → core::bool}, as.{core::int::>>}(1){(core::int) → core::int}); +} +static method a(core::bool x, core::bool y, core::int z) → void { + core::print("${x} ${y} ${z}"); +} diff --git a/pkg/front_end/testcases/general/issue_47009_02.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue_47009_02.dart.weak.outline.expect new file mode 100644 index 00000000000..35353cd2b37 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_02.dart.weak.outline.expect @@ -0,0 +1,8 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic + ; +static method a(core::bool x, core::bool y, core::int z) → void + ; diff --git a/pkg/front_end/testcases/general/issue_47009_02.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue_47009_02.dart.weak.transformed.expect new file mode 100644 index 00000000000..c5218bb98ed --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_02.dart.weak.transformed.expect @@ -0,0 +1,15 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int d = 3; + core::int e = 4; + core::int as = 5; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, d.{core::num::<}(e){(core::num) → core::bool}, as.{core::int::>>}(1){(core::int) → core::int}); +} +static method a(core::bool x, core::bool y, core::int z) → void { + core::print("${x} ${y} ${z}"); +} diff --git a/pkg/front_end/testcases/general/issue_47009_03.dart b/pkg/front_end/testcases/general/issue_47009_03.dart new file mode 100644 index 00000000000..50afad902c6 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_03.dart @@ -0,0 +1,14 @@ +main() { + int b = 1; + int c = 2; + int d = 3; + int e = 4; + int f = 5; + int g = 6; + int as = 7; + a(b < c, d < e, f < g, as >>> (1)); +} + +void a(bool x, bool y, bool z1, int z2) { + print("$x $y $z1 $z2"); +} \ No newline at end of file diff --git a/pkg/front_end/testcases/general/issue_47009_03.dart.textual_outline.expect b/pkg/front_end/testcases/general/issue_47009_03.dart.textual_outline.expect new file mode 100644 index 00000000000..3f2b123a262 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_03.dart.textual_outline.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y, bool z1, int z2) {} diff --git a/pkg/front_end/testcases/general/issue_47009_03.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/issue_47009_03.dart.textual_outline_modelled.expect new file mode 100644 index 00000000000..3f2b123a262 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_03.dart.textual_outline_modelled.expect @@ -0,0 +1,2 @@ +main() {} +void a(bool x, bool y, bool z1, int z2) {} diff --git a/pkg/front_end/testcases/general/issue_47009_03.dart.weak.expect b/pkg/front_end/testcases/general/issue_47009_03.dart.weak.expect new file mode 100644 index 00000000000..1d366c463c7 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_03.dart.weak.expect @@ -0,0 +1,17 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int d = 3; + core::int e = 4; + core::int f = 5; + core::int g = 6; + core::int as = 7; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, d.{core::num::<}(e){(core::num) → core::bool}, f.{core::num::<}(g){(core::num) → core::bool}, as.{core::int::>>>}(1){(core::int) → core::int}); +} +static method a(core::bool x, core::bool y, core::bool z1, core::int z2) → void { + core::print("${x} ${y} ${z1} ${z2}"); +} diff --git a/pkg/front_end/testcases/general/issue_47009_03.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue_47009_03.dart.weak.outline.expect new file mode 100644 index 00000000000..b349da92227 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_03.dart.weak.outline.expect @@ -0,0 +1,8 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic + ; +static method a(core::bool x, core::bool y, core::bool z1, core::int z2) → void + ; diff --git a/pkg/front_end/testcases/general/issue_47009_03.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue_47009_03.dart.weak.transformed.expect new file mode 100644 index 00000000000..1d366c463c7 --- /dev/null +++ b/pkg/front_end/testcases/general/issue_47009_03.dart.weak.transformed.expect @@ -0,0 +1,17 @@ +library /*isNonNullableByDefault*/; +import self as self; +import "dart:core" as core; + +static method main() → dynamic { + core::int b = 1; + core::int c = 2; + core::int d = 3; + core::int e = 4; + core::int f = 5; + core::int g = 6; + core::int as = 7; + self::a(b.{core::num::<}(c){(core::num) → core::bool}, d.{core::num::<}(e){(core::num) → core::bool}, f.{core::num::<}(g){(core::num) → core::bool}, as.{core::int::>>>}(1){(core::int) → core::int}); +} +static method a(core::bool x, core::bool y, core::bool z1, core::int z2) → void { + core::print("${x} ${y} ${z1} ${z2}"); +}