Initial parser support for constructor tear-offs.

This CL adds parser support for use of `<typeArguments>` as a
selector.  This allows expressions like `List<int>` (type literal with
type arguments), `f<int>` (function tear-off with type arguments),
`C.m<int>` (static method tear-off with type arguments), `EXPR.m<int>`
(instance method tear-off with type arguments), and `EXPR<int>`
(tear-off of `.call` method with type arguments).

I will add parser support for `.new` as a constructor name in a
follow-up CL.

Change-Id: I157e732276421e8c3fd20c38c67ae9643993bd85
Bug: https://github.com/dart-lang/sdk/issues/46020, https://github.com/dart-lang/sdk/issues/46044.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197102
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This commit is contained in:
Paul Berry 2021-05-25 13:58:10 +00:00 committed by commit-bot@chromium.org
parent 4a0d89bfc6
commit 126c5fa680
48 changed files with 4492 additions and 191 deletions

View file

@ -780,6 +780,11 @@ class ForwardingListener implements Listener {
listener?.endFunctionTypedFormalParameter(nameToken, question);
}
@override
void handleTypeArgumentApplication(Token openAngleBracket) {
listener?.handleTypeArgumentApplication(openAngleBracket);
}
@override
void endHide(Token hideKeyword) {
listener?.endHide(hideKeyword);

View file

@ -1727,4 +1727,19 @@ class Listener implements UnescapeErrorListener {
/// This event is generated by the parser when the parser's
/// `parseOneCommentReference` method is called.
void handleNoCommentReference() {}
/// An expression was encountered consisting of type arguments applied to a
/// subexpression. This could validly represent any of the following:
/// - A type literal (`var x = List<int>;`)
/// - A function tear-off with type arguments (`var x = f<int>;` or
/// `var x = importPrefix.f<int>;`)
/// - A static method tear-off with type arguments (`var x = ClassName.m<int>`
/// or `var x = importPrefix.ClassName.m<int>;`)
/// - An instance method tear-off with type arguments (`var x = EXPR.m<int>;`)
///
/// Or, in the event of invalid code, it could represent type arguments
/// erroneously applied to some other expression type (e.g.
/// `var x = (f)<int>;`). The client is responsible for reporting an error if
/// this occurs.
void handleTypeArgumentApplication(Token openAngleBracket) {}
}

View file

@ -4793,7 +4793,10 @@ class Parser {
listener.handleNonNullAssertExpression(bangToken);
}
token = typeArg.parseArguments(bangToken, this);
assert(optional('(', token.next!));
if (!optional('(', token.next!)) {
listener.handleTypeArgumentApplication(bangToken.next!);
typeArg = noTypeParamOrArg;
}
}
return _parsePrecedenceExpressionLoop(
@ -4861,7 +4864,10 @@ class Parser {
listener.handleNonNullAssertExpression(bangToken);
}
token = typeArg.parseArguments(bangToken, this);
assert(optional('(', token.next!));
if (!optional('(', token.next!)) {
listener.handleTypeArgumentApplication(bangToken.next!);
typeArg = noTypeParamOrArg;
}
}
} else if (identical(type, TokenType.OPEN_PAREN) ||
identical(type, TokenType.OPEN_SQUARE_BRACKET)) {
@ -5174,8 +5180,13 @@ class Parser {
TypeParamOrArgInfo typeArg = computeTypeParamOrArg(identifier);
if (typeArg != noTypeParamOrArg) {
Token endTypeArguments = typeArg.skip(identifier);
if (optional(".", endTypeArguments.next!)) {
return parseImplicitCreationExpression(token, typeArg);
Token afterTypeArguments = endTypeArguments.next!;
if (optional(".", afterTypeArguments)) {
Token afterPeriod = afterTypeArguments.next!;
if (afterPeriod.isIdentifier &&
optional('(', afterPeriod.next!)) {
return parseImplicitCreationExpression(token, typeArg);
}
}
}
}

View file

@ -348,7 +348,53 @@ TypeParamOrArgInfo computeTypeParamOrArg(Token token,
/// possible other constructs will pass (e.g., 'a < C, D > 3').
TypeParamOrArgInfo computeMethodTypeArguments(Token token) {
TypeParamOrArgInfo typeArg = computeTypeParamOrArg(token);
return optional('(', typeArg.skip(token).next!) && !typeArg.recovered
return mayFollowTypeArgs(typeArg.skip(token).next!) && !typeArg.recovered
? typeArg
: noTypeParamOrArg;
}
/// Indicates whether the given [token] is allowed to follow a list of type
/// arguments used as a selector after an expression.
///
/// This is used for disambiguating constructs like `f(a<b,c>(d))` and
/// `f(a<b,c>-d)`. In the case of `f(a<b,c>(d))`, `true` will be returned,
/// indicating that the `<` and `>` should be interpreted as delimiting type
/// arguments (so one argument is being passed to `f` -- a call to the generic
/// function `a`). In the case of `f(a<b,c>-d)`, `false` will be returned,
/// indicating that the `<` and `>` should be interpreted as operators (so two
/// arguments are being passed to `f`: `a < b` and `c > -d`).
bool mayFollowTypeArgs(Token token) {
const Set<String> tokensThatMayFollowTypeArg = {
'(',
')',
']',
'}',
':',
';',
',',
'.',
'?',
'==',
'!=',
'..',
'?.',
'??',
'?..',
'&',
'|',
'^',
'+',
'*',
'%',
'/',
'~/'
};
if (token.type == TokenType.EOF) {
// The spec doesn't have anything to say about this case, since an
// expression can't occur at the end of a file, but for testing it's to our
// advantage to allow EOF after type arguments, so that an isolated `f<x>`
// can be parsed as an expression.
return true;
}
return tokensThatMayFollowTypeArg.contains(token.lexeme);
}

View file

@ -16,6 +16,9 @@ abstract class Feature {
/// Feature information for non-nullability by default.
static final non_nullable = ExperimentalFeatures.non_nullable;
/// Feature information for constructor tear-offs.
static final constructor_tearoffs = ExperimentalFeatures.constructor_tearoffs;
/// Feature information for control flow collections.
static final control_flow_collections =
ExperimentalFeatures.control_flow_collections;

View file

@ -140,6 +140,9 @@ class AstBuilder extends StackListener {
/// `true` if variance behavior is enabled
final bool enableVariance;
/// `true` if constructor tearoffs are enabled
final bool enableConstructorTearoffs;
final FeatureSet _featureSet;
AstBuilder(ErrorReporter errorReporter, this.fileUri, this.isFullAst,
@ -155,6 +158,8 @@ class AstBuilder extends StackListener {
enableNonFunctionTypeAliases =
_featureSet.isEnabled(Feature.nonfunction_type_aliases),
enableVariance = _featureSet.isEnabled(Feature.variance),
enableConstructorTearoffs =
_featureSet.isEnabled(Feature.constructor_tearoffs),
uri = uri ?? fileUri;
NodeList<ClassMember> get currentDeclarationMembers {
@ -3513,6 +3518,39 @@ class AstBuilder extends StackListener {
push(ast.typeName(name, arguments, question: questionMark));
}
@override
void handleTypeArgumentApplication(Token openAngleBracket) {
var typeArguments = pop() as TypeArgumentList;
var receiver = pop() as Expression;
if (!enableConstructorTearoffs) {
var feature = ExperimentalFeatures.constructor_tearoffs;
handleRecoverableError(
templateExperimentNotEnabled.withArguments(
feature.enableString,
_versionAsString(ExperimentStatus.currentVersion),
),
typeArguments.leftBracket,
typeArguments.rightBracket,
);
// Since analyzer visitors don't yet support constructor tear-offs, create
// a FunctionExpressionInvocation with a synthetic argument list instead.
// TODO(paulberry): once we have visitor support for constructor
// tear-offs, fall through and return a FunctionReference instead since
// that should lead to better quality error recovery.
var syntheticOffset = typeArguments.rightBracket.end;
push(ast.functionExpressionInvocation(
receiver,
typeArguments,
ast.argumentList(
SyntheticToken(TokenType.OPEN_PAREN, syntheticOffset),
[],
SyntheticToken(TokenType.CLOSE_PAREN, syntheticOffset))));
return;
}
push(ast.functionReference(
function: receiver, typeArguments: typeArguments));
}
@override
void handleTypeVariablesDefined(Token token, int count) {
debugEvent("handleTypeVariablesDefined");

View file

@ -0,0 +1,357 @@
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'parser_test_base.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(FunctionReferenceParserTest);
});
}
/// Tests exercising the fasta parser's handling of generic instantiations.
@reflectiveTest
class FunctionReferenceParserTest extends FastaParserTestCase {
/// Verifies that the given [node] matches `f<a, b>`.
void expect_f_a_b(AstNode node) {
var functionReference = node as FunctionReference;
expect((functionReference.function as SimpleIdentifier).name, 'f');
var typeArgs = functionReference.typeArguments!.arguments;
expect(typeArgs, hasLength(2));
expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
}
void expect_two_args(MethodInvocation methodInvocation) {
var arguments = methodInvocation.argumentList.arguments;
expect(arguments, hasLength(2));
expect(arguments[0], TypeMatcher<BinaryExpression>());
expect(arguments[1], TypeMatcher<BinaryExpression>());
}
void test_feature_disabled() {
var expression =
(parseStatement('f<a, b>;', featureSet: preConstructorTearoffs)
as ExpressionStatement)
.expression;
// TODO(paulberry): once we have visitor support for FunctionReference, this
// should be parsed as a FunctionReference, so we should be able to validate
// it using `expect_f_a_b`. But for now it's parsed as a
// FunctionExpressionInvocation with synthetic arguments.
var functionExpressionInvocation =
expression as FunctionExpressionInvocation;
expect(
(functionExpressionInvocation.function as SimpleIdentifier).name, 'f');
expect(functionExpressionInvocation.argumentList.arguments, isEmpty);
var typeArgs = functionExpressionInvocation.typeArguments!.arguments;
expect(typeArgs, hasLength(2));
expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
listener.assertErrors([
expectedError(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 1, 6),
]);
}
void test_followingToken_accepted_ampersand() {
expect_f_a_b(
(parseExpression('f<a, b> & 0', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_asterisk() {
expect_f_a_b(
(parseExpression('f<a, b> * 0', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_bar() {
expect_f_a_b(
(parseExpression('f<a, b> | 0', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_caret() {
expect_f_a_b(
(parseExpression('f<a, b> ^ 0', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_closeBrace() {
expect_f_a_b((parseExpression('{f<a, b>}', featureSet: constructorTearoffs)
as SetOrMapLiteral)
.elements[0]);
}
void test_followingToken_accepted_closeBracket() {
expect_f_a_b((parseExpression('[f<a, b>]', featureSet: constructorTearoffs)
as ListLiteral)
.elements[0]);
}
void test_followingToken_accepted_closeParen() {
expect_f_a_b((parseExpression('g(f<a, b>)', featureSet: constructorTearoffs)
as MethodInvocation)
.argumentList
.arguments[0]);
}
void test_followingToken_accepted_colon() {
expect_f_a_b(
((parseExpression('{f<a, b>: null}', featureSet: constructorTearoffs)
as SetOrMapLiteral)
.elements[0] as MapLiteralEntry)
.key);
}
void test_followingToken_accepted_comma() {
expect_f_a_b(
(parseExpression('[f<a, b>, null]', featureSet: constructorTearoffs)
as ListLiteral)
.elements[0]);
}
void test_followingToken_accepted_equals() {
expect_f_a_b(
(parseExpression('f<a, b> == null', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_not_equals() {
expect_f_a_b(
(parseExpression('f<a, b> != null', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_openParen() {
// This is a special case because when a `(` follows `<typeArguments>` it is
// parsed as a MethodInvocation rather than a GenericInstantiation.
var methodInvocation =
parseExpression('f<a, b>()', featureSet: constructorTearoffs)
as MethodInvocation;
expect(methodInvocation.methodName.name, 'f');
var typeArgs = methodInvocation.typeArguments!.arguments;
expect(typeArgs, hasLength(2));
expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
expect(methodInvocation.argumentList.arguments, isEmpty);
}
void test_followingToken_accepted_percent() {
expect_f_a_b(
(parseExpression('f<a, b> % 0', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_period_methodInvocation() {
// This is a special case because `f<a, b>.methodName(...)` is parsed as an
// InstanceCreationExpression.
var instanceCreationExpression =
parseExpression('f<a, b>.toString()', featureSet: constructorTearoffs)
as InstanceCreationExpression;
var constructorName = instanceCreationExpression.constructorName;
var type = constructorName.type;
expect((type.name as SimpleIdentifier).name, 'f');
var typeArgs = type.typeArguments!.arguments;
expect(typeArgs, hasLength(2));
expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
expect(constructorName.name!.name, 'toString');
expect(instanceCreationExpression.argumentList.arguments, isEmpty);
}
void test_followingToken_accepted_period_methodInvocation_generic() {
expect_f_a_b(
(parseExpression('f<a, b>.foo<c>()', featureSet: constructorTearoffs)
as MethodInvocation)
.target!);
}
void test_followingToken_accepted_period_period() {
expect_f_a_b(
(parseExpression('f<a, b>..toString()', featureSet: constructorTearoffs)
as CascadeExpression)
.target);
}
void test_followingToken_accepted_period_propertyAccess() {
expect_f_a_b(
(parseExpression('f<a, b>.hashCode', featureSet: constructorTearoffs)
as PropertyAccess)
.target!);
}
void test_followingToken_accepted_plus() {
expect_f_a_b(
(parseExpression('f<a, b> + 0', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_question() {
expect_f_a_b((parseExpression('f<a, b> ? null : null',
featureSet: constructorTearoffs) as ConditionalExpression)
.condition);
}
void test_followingToken_accepted_question_period_methodInvocation() {
expect_f_a_b(
(parseExpression('f<a, b>?.toString()', featureSet: constructorTearoffs)
as MethodInvocation)
.target!);
}
void test_followingToken_accepted_question_period_methodInvocation_generic() {
expect_f_a_b(
(parseExpression('f<a, b>?.foo<c>()', featureSet: constructorTearoffs)
as MethodInvocation)
.target!);
}
void test_followingToken_accepted_question_period_period() {
expect_f_a_b((parseExpression('f<a, b>?..toString()',
featureSet: constructorTearoffs) as CascadeExpression)
.target);
}
void test_followingToken_accepted_question_period_propertyAccess() {
expect_f_a_b(
(parseExpression('f<a, b>?.hashCode', featureSet: constructorTearoffs)
as PropertyAccess)
.target!);
}
void test_followingToken_accepted_question_question() {
expect_f_a_b(
(parseExpression('f<a, b> ?? 0', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_semicolon() {
expect_f_a_b((parseStatement('f<a, b>;', featureSet: constructorTearoffs)
as ExpressionStatement)
.expression);
listener.assertNoErrors();
}
void test_followingToken_accepted_slash() {
expect_f_a_b(
(parseExpression('f<a, b> / 1', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_accepted_tilde_slash() {
expect_f_a_b(
(parseExpression('f<a, b> ~/ 1', featureSet: constructorTearoffs)
as BinaryExpression)
.leftOperand);
}
void test_followingToken_rejected_bang_openBracket() {
expect_two_args(
parseExpression('f(a<b,c>![d])', featureSet: constructorTearoffs)
as MethodInvocation);
}
void test_followingToken_rejected_bang_paren() {
expect_two_args(
parseExpression('f(a<b,c>!(d))', featureSet: constructorTearoffs)
as MethodInvocation);
}
void test_followingToken_rejected_lessThan() {
// Note: in principle we could parse this as a generic instantiation of a
// generic instantiation, but such an expression would be meaningless so we
// reject it at the parser level.
parseExpression('f<a><b>', featureSet: constructorTearoffs, errors: [
expectedError(ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, 3, 1),
expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 0),
]);
}
void test_followingToken_rejected_minus() {
expect_two_args(
parseExpression('f(a<b,c>-d)', featureSet: constructorTearoffs)
as MethodInvocation);
}
void test_followingToken_rejected_openBracket() {
expect_two_args(
parseExpression('f(a<b,c>[d])', featureSet: constructorTearoffs)
as MethodInvocation);
}
void test_followingToken_rejected_openBracket_error() {
// Note that theoretically this could be successfully parsed by interpreting
// `<` and `>` as delimiting type arguments, but the parser doesn't have
// enough lookahead to see that this is the only possible error-free parse;
// it commits to interpreting `<` and `>` as operators when it sees the `[`.
expect_two_args(parseExpression('f(a<b,c>[d]>e)',
featureSet: constructorTearoffs,
errors: [
expectedError(
ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, 11, 1),
]) as MethodInvocation);
}
void test_followingToken_rejected_openBracket_unambiguous() {
expect_two_args(
parseExpression('f(a<b,c>[d, e])', featureSet: constructorTearoffs)
as MethodInvocation);
}
void test_methodTearoff() {
var functionReference =
parseExpression('f().m<a, b>', featureSet: constructorTearoffs)
as FunctionReference;
var function = functionReference.function as PropertyAccess;
var target = function.target as MethodInvocation;
expect(target.methodName.name, 'f');
expect(function.propertyName.name, 'm');
var typeArgs = functionReference.typeArguments!.arguments;
expect(typeArgs, hasLength(2));
expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
}
void test_prefixedIdentifier() {
var functionReference =
parseExpression('prefix.f<a, b>', featureSet: constructorTearoffs)
as FunctionReference;
var function = functionReference.function as PrefixedIdentifier;
expect(function.prefix.name, 'prefix');
expect(function.identifier.name, 'f');
var typeArgs = functionReference.typeArguments!.arguments;
expect(typeArgs, hasLength(2));
expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
}
void test_three_identifiers() {
var functionReference = parseExpression('prefix.ClassName.m<a, b>',
featureSet: constructorTearoffs) as FunctionReference;
var function = functionReference.function as PropertyAccess;
var target = function.target as PrefixedIdentifier;
expect(target.prefix.name, 'prefix');
expect(target.identifier.name, 'ClassName');
expect(function.propertyName.name, 'm');
var typeArgs = functionReference.typeArguments!.arguments;
expect(typeArgs, hasLength(2));
expect(((typeArgs[0] as TypeName).name as SimpleIdentifier).name, 'a');
expect(((typeArgs[1] as TypeName).name as SimpleIdentifier).name, 'b');
}
}

View file

@ -220,12 +220,18 @@ class FastaParserTestCase
implements AbstractParserTestCase {
static final List<ErrorCode> NO_ERROR_COMPARISON = <ErrorCode>[];
final constructorTearoffs = FeatureSet.forTesting(
sdkVersion: '2.14.0', additionalFeatures: [Feature.constructor_tearoffs]);
final controlFlow = FeatureSet.latestLanguageVersion();
final spread = FeatureSet.latestLanguageVersion();
final nonNullable = FeatureSet.latestLanguageVersion();
final preConstructorTearoffs = FeatureSet.fromEnableFlags2(
sdkLanguageVersion: Version.parse('2.13.0'), flags: []);
final preNonNullable = FeatureSet.fromEnableFlags2(
sdkLanguageVersion: Version.parse('2.9.0'),
flags: [],

View file

@ -1419,15 +1419,14 @@ var c = Future<int>.sync(() => 3).then<int>((e) => e);
expect(unit, isNotNull);
var f = unit.declarations[0] as FunctionDeclaration;
var body = f.functionExpression.body as ExpressionFunctionBody;
expect(body.expression, isInstanceCreationExpression);
var creation = body.expression as InstanceCreationExpressionImpl;
expect(creation.keyword, isNull);
ConstructorName constructorName = creation.constructorName;
expect(constructorName.type.toSource(), 'C<E>');
expect(constructorName.period, isNotNull);
expect(constructorName.name, isNotNull);
expect(creation.argumentList, isNotNull);
expect(creation.typeArguments!.arguments, hasLength(1));
expect(body.expression, isMethodInvocation);
var methodInvocation = body.expression as MethodInvocationImpl;
var target = methodInvocation.target!;
expect(target, isFunctionExpressionInvocation);
expect(target.toSource(), 'C<E>()');
expect(methodInvocation.methodName.name, 'n');
expect(methodInvocation.argumentList, isNotNull);
expect(methodInvocation.typeArguments!.arguments, hasLength(1));
}
void test_parseInstanceCreation_noKeyword_prefix() {

View file

@ -16,6 +16,7 @@ import 'error_suppression_test.dart' as error_suppression;
import 'expression_parser_test.dart' as expression_parser;
import 'extension_methods_parser_test.dart' as extension_methods_parser;
import 'formal_parameter_parser_test.dart' as formal_parameter_parser;
import 'function_reference_parser_test.dart' as function_reference_parser;
import 'generic_metadata_parser_test.dart' as generic_metadata_parser;
import 'invalid_code_test.dart' as invalid_code;
import 'issues_test.dart' as issues;
@ -56,6 +57,7 @@ main() {
expression_parser.main();
extension_methods_parser.main();
formal_parameter_parser.main();
function_reference_parser.main();
generic_metadata_parser.main();
invalid_code.main();
issues.main();

View file

@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../dart/resolution/context_collection_resolution.dart';
@ -15,6 +16,43 @@ main() {
@reflectiveTest
class ExperimentNotEnabledTest extends PubPackageResolutionTest {
test_constructor_tearoffs_disabled_grammar() async {
await assertErrorsInCode('''
class Foo<X> {
const Foo.bar();
int get baz => 0;
}
main() {
Foo<int>.bar.baz();
}
''', [
// TODO(paulberry): the INVOCATION_OF_NON_FUNCTION_EXPRESSION error is
// bogus, and should go away once we implement visitor and resolution
// support for constructor tearoffs.
error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 67, 3),
error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 70, 5),
]);
}
test_constructor_tearoffs_disabled_grammar_pre_nnbd() async {
await assertErrorsInCode('''
// @dart=2.9
class Foo<X> {
const Foo.bar();
int get baz => 0;
}
main() {
Foo<int>.bar.baz();
}
''', [
// TODO(paulberry): the INVOCATION_OF_NON_FUNCTION_EXPRESSION error is
// bogus, and should go away once we implement visitor and resolution
// support for constructor tearoffs.
error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, 80, 3),
error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 83, 5),
]);
}
test_nonFunctionTypeAliases_disabled() async {
await assertErrorsInCode(r'''
// @dart = 2.12

View file

@ -128,6 +128,8 @@ const isFunctionExpression = TypeMatcher<FunctionExpression>();
const isFunctionExpressionInvocation =
TypeMatcher<FunctionExpressionInvocation>();
const isFunctionReference = TypeMatcher<FunctionReference>();
const isFunctionTypeAlias = TypeMatcher<FunctionTypeAlias>();
const isFunctionTypedFormalParameter =

View file

@ -75,7 +75,13 @@ import '../dill/dill_library_builder.dart' show DillLibraryBuilder;
import '../fasta_codes.dart' as fasta;
import '../fasta_codes.dart' show LocatedMessage, Message, noLength, Template;
import '../fasta_codes.dart'
show
LocatedMessage,
Message,
Template,
noLength,
templateExperimentNotEnabled;
import '../identifiers.dart'
show Identifier, InitializedIdentifier, QualifiedName, flattenName;
@ -6294,6 +6300,18 @@ class BodyBuilder extends ScopeListener<JumpTarget>
}
}
@override
void handleTypeArgumentApplication(Token openAngleBracket) {
/// TODO(johnniwinther, paulberry): add support for this construct when the
/// "constructor-tearoffs" feature is enabled.
pop(); // typeArguments
addProblem(
templateExperimentNotEnabled.withArguments('constructor-tearoffs',
libraryBuilder.enableConstructorTearoffsVersionInLibrary.toText()),
openAngleBracket.charOffset,
noLength);
}
@override
UnresolvedType validateTypeUse(UnresolvedType unresolved,
{bool nonInstanceAccessIsError, bool allowPotentiallyConstantType}) {

View file

@ -313,6 +313,7 @@ class SourceLibraryBuilder extends LibraryBuilderImpl {
bool _enableNonfunctionTypeAliasesInLibrary;
bool _enableNonNullableInLibrary;
Version _enableNonNullableVersionInLibrary;
Version _enableConstructorTearoffsVersionInLibrary;
bool _enableTripleShiftInLibrary;
bool _enableExtensionMethodsInLibrary;
bool _enableGenericMetadataInLibrary;
@ -350,6 +351,11 @@ class SourceLibraryBuilder extends LibraryBuilderImpl {
.getExperimentEnabledVersionInLibrary(
ExperimentalFlag.nonNullable, _packageUri ?? importUri);
Version get enableConstructorTearoffsVersionInLibrary =>
_enableConstructorTearoffsVersionInLibrary ??= loader.target
.getExperimentEnabledVersionInLibrary(
ExperimentalFlag.constructorTearoffs, _packageUri ?? importUri);
bool get enableTripleShiftInLibrary => _enableTripleShiftInLibrary ??=
loader.target.isExperimentEnabledInLibraryByVersion(
ExperimentalFlag.tripleShift,

View file

@ -2542,6 +2542,14 @@ abstract class AbstractDirectParserASTListener implements Listener {
DirectParserASTType.HANDLE);
seen(data);
}
void handleTypeArgumentApplication(Token openAngleBracket) {
DirectParserASTContentTypeArgumentApplicationHandle data =
new DirectParserASTContentTypeArgumentApplicationHandle(
DirectParserASTType.HANDLE,
openAngleBracket: openAngleBracket);
seen(data);
}
}
class DirectParserASTContentArgumentsBegin extends DirectParserASTContent {
@ -6861,3 +6869,16 @@ class DirectParserASTContentNoCommentReferenceHandle
Map<String, Object?> get deprecatedArguments => {};
}
class DirectParserASTContentTypeArgumentApplicationHandle
extends DirectParserASTContent {
final Token openAngleBracket;
DirectParserASTContentTypeArgumentApplicationHandle(DirectParserASTType type,
{required this.openAngleBracket})
: super("TypeArgumentApplication", type);
Map<String, Object?> get deprecatedArguments => {
"openAngleBracket": openAngleBracket,
};
}

View file

@ -0,0 +1,91 @@
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE.md file.
// The test cases called `typeArgs_...` verify that `<` and `>` are treated as
// delimiting type arguments when the `>` is followed by one of the tokens:
//
// ( ) ] } : ; , . ? == != .. ?. ?? ?..
// & | ^ + * % / ~/
//
// Unless otherwise noted, these test cases should not result in a parse error,
// because they can be made into valid expressions through user-defined
// operators.
var typeArgs_ampersand = f<a, b> & 0;
var typeArgs_asterisk = f<a, b> * 0;
var typeArgs_bar = f<a, b> | 0;
var typeArgs_caret = f<a, b> ^ 0;
var typeArgs_closeBrace = {f<a, b>};
var typeArgs_closeBracket = [f<a, b>];
var typeArgs_closeParen = g(f<a, b>);
var typeArgs_colon = {f<a, b>: null};
var typeArgs_comma = [f<a, b>, null];
var typeArgs_equals = f<a, b> == null;
var typeArgs_not_equals = f<a, b> != null;
// This is a special case because when a `(` follows `<typeArguments>` it is
// parsed as a MethodInvocation rather than a GenericInstantiation.
var typeArgs_openParen = f<a, b>();
var typeArgs_percent = f<a, b> % 0;
// This is a special case because `f<a, b>.methodName(...)` is parsed as an
// InstanceCreationExpression.
var typeArgs_period_methodInvocation = f<a, b>.toString();
var typeArgs_period_methodInvocation_generic = f<a, b>.foo<c>();
var typeArgs_period_period = f<a, b>..toString();
var typeArgs_period_propertyAccess = f<a, b>.hashCode;
var typeArgs_plus = f<a, b> + 0;
// Note: this could never be a valid expression because the thing to the left of
// `?` is required to have type `bool`, and `f<a, b>` can only have type `Type`
// or a function type. But it is not the responsibility of the parser to report
// an error here; that should be done by type analysis.
var typeArgs_question = f<a, b> ? null : null;
var typeArgs_question_period_methodInvocation = f<a, b>?.toString();
var typeArgs_question_period_methodInvocation_generic = f<a, b>?.foo<c>();
var typeArgs_question_period_period = f<a, b>?..toString();
var typeArgs_question_period_propertyAccess = f<a, b>?.hashCode;
var typeArgs_question_question = f<a, b> ?? 0;
var typeArgs_semicolon = f<a, b>;
var typeArgs_slash = f<a, b> / 1;
var typeArgs_tilde_slash = f<a, b> ~/ 1;
// The test cases called `operators_...` verify that `<` and `>` are treated as
// operators when the `>` is not followed by one of the tokens:
//
// ( ) ] } : ; , . ? == != .. ?. ?? ?..
// & | ^ + * % / ~/
//
// Unless otherwise noted, these test cases should not result in a parse error,
// because they can be made into valid expressions through user-defined
// operators.
// Note: this could never be a valid expression because the thing to the right
// of `!` is required to have type `bool`, and the type of `[d]` will always be
// a list type. But it is not the responsibility of the parser to report an
// error here; that should be done by type analysis.
var operators_bang_openBracket = f(a<b,c>![d]);
var operators_bang_paren = f(a<b,c>!(d));
// Note: in principle we could parse this as a generic instantiation of a
// generic instantiation, but since `<` is not one of the tokens that signals
// `<` and `>` to be treated as type argument delimiters, the first pair of `<`
// and `>` is treated as operators, and this results in a parse error.
var operators_lessThan = f<a><b>;
var operators_minus = f(a<b,c>-d);
var operators_openBracket = f(a<b,c>[d]);
// Note: in principle we could parse `<b, c>` as type arguments, `[d]` as an
// index operation, and the final `>` as a greater-than operator, but since `[`
// is not one of the tokens that signals `<` and `>` to be treated as argument
// delimiters, the pair of `<` and `>` is treated as operators, and this results
// in a parse error.
var operators_openBracket_error = f(a<b,c>[d]>e);
var operators_openBracket_unambiguous = f(a<b,c>[d, e]);

View file

@ -0,0 +1,159 @@
NOTICE: Stream was rewritten by parser!
var typeArgs_ampersand = f<a, b> & 0;
var typeArgs_asterisk = f<a, b> * 0;
var typeArgs_bar = f<a, b> | 0;
var typeArgs_caret = f<a, b> ^ 0;
var typeArgs_closeBrace = {f<a, b>};
var typeArgs_closeBracket = [f<a, b>];
var typeArgs_closeParen = g(f<a, b>);
var typeArgs_colon = {f<a, b>: null};
var typeArgs_comma = [f<a, b>, null];
var typeArgs_equals = f<a, b> == null;
var typeArgs_not_equals = f<a, b> != null;
var typeArgs_openParen = f<a, b>();
var typeArgs_percent = f<a, b> % 0;
var typeArgs_period_methodInvocation = f<a, b>.toString();
var typeArgs_period_methodInvocation_generic = f<a, b>.foo<c>();
var typeArgs_period_period = f<a, b>..toString();
var typeArgs_period_propertyAccess = f<a, b>.hashCode;
var typeArgs_plus = f<a, b> + 0;
var typeArgs_question = f<a, b> ? null : null;
var typeArgs_question_period_methodInvocation = f<a, b>?.toString();
var typeArgs_question_period_methodInvocation_generic = f<a, b>?.foo<c>();
var typeArgs_question_period_period = f<a, b>?..toString();
var typeArgs_question_period_propertyAccess = f<a, b>?.hashCode;
var typeArgs_question_question = f<a, b> ?? 0;
var typeArgs_semicolon = f<a, b>;
var typeArgs_slash = f<a, b> / 1;
var typeArgs_tilde_slash = f<a, b> ~/ 1;
var operators_bang_openBracket = f(a<b,c>![d]);
var operators_bang_paren = f(a<b,c>!(d));
var operators_lessThan = f<a><b>[];
var operators_minus = f(a<b,c>-d);
var operators_openBracket = f(a<b,c>[d]);
var operators_openBracket_error = f(a<b,c>[d]>e);
var operators_openBracket_unambiguous = f(a<b,c>[d, e]);
var[KeywordToken] typeArgs_ampersand[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] &[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_asterisk[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] *[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_bar[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] |[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_caret[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ^[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_closeBrace[StringToken] =[SimpleToken] {[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]}[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_closeBracket[StringToken] =[SimpleToken] [[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]][SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_closeParen[StringToken] =[SimpleToken] g[StringToken]([BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_colon[StringToken] =[SimpleToken] {[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]:[SimpleToken] null[KeywordToken]}[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_comma[StringToken] =[SimpleToken] [[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken],[SimpleToken] null[KeywordToken]][SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_equals[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ==[SimpleToken] null[KeywordToken];[SimpleToken]
var[KeywordToken] typeArgs_not_equals[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] !=[SimpleToken] null[KeywordToken];[SimpleToken]
var[KeywordToken] typeArgs_openParen[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_percent[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] %[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_period_methodInvocation[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_period_methodInvocation_generic[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]foo[StringToken]<[BeginToken]c[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_period_period[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]..[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_period_propertyAccess[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]hashCode[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_plus[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] +[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_question[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ?[SimpleToken] null[KeywordToken] :[SimpleToken] null[KeywordToken];[SimpleToken]
var[KeywordToken] typeArgs_question_period_methodInvocation[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_question_period_methodInvocation_generic[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]foo[StringToken]<[BeginToken]c[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_question_period_period[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?..[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_question_period_propertyAccess[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]hashCode[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_question_question[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ??[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_semicolon[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_slash[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] /[SimpleToken] 1[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_tilde_slash[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ~/[SimpleToken] 1[StringToken];[SimpleToken]
var[KeywordToken] operators_bang_openBracket[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]![SimpleToken][[BeginToken]d[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_bang_paren[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]![SimpleToken]([BeginToken]d[StringToken])[SimpleToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_lessThan[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken]>[SimpleToken]<[BeginToken]b[StringToken]>[SimpleToken][[SyntheticBeginToken]][SyntheticToken];[SimpleToken]
var[KeywordToken] operators_minus[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]-[SimpleToken]d[StringToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_openBracket[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_openBracket_error[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken]][SimpleToken]>[SimpleToken]e[StringToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_openBracket_unambiguous[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken],[SimpleToken] e[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,157 @@
var typeArgs_ampersand = f<a, b> & 0;
var typeArgs_asterisk = f<a, b> * 0;
var typeArgs_bar = f<a, b> | 0;
var typeArgs_caret = f<a, b> ^ 0;
var typeArgs_closeBrace = {f<a, b>};
var typeArgs_closeBracket = [f<a, b>];
var typeArgs_closeParen = g(f<a, b>);
var typeArgs_colon = {f<a, b>: null};
var typeArgs_comma = [f<a, b>, null];
var typeArgs_equals = f<a, b> == null;
var typeArgs_not_equals = f<a, b> != null;
var typeArgs_openParen = f<a, b>();
var typeArgs_percent = f<a, b> % 0;
var typeArgs_period_methodInvocation = f<a, b>.toString();
var typeArgs_period_methodInvocation_generic = f<a, b>.foo<c>();
var typeArgs_period_period = f<a, b>..toString();
var typeArgs_period_propertyAccess = f<a, b>.hashCode;
var typeArgs_plus = f<a, b> + 0;
var typeArgs_question = f<a, b> ? null : null;
var typeArgs_question_period_methodInvocation = f<a, b>?.toString();
var typeArgs_question_period_methodInvocation_generic = f<a, b>?.foo<c>();
var typeArgs_question_period_period = f<a, b>?..toString();
var typeArgs_question_period_propertyAccess = f<a, b>?.hashCode;
var typeArgs_question_question = f<a, b> ?? 0;
var typeArgs_semicolon = f<a, b>;
var typeArgs_slash = f<a, b> / 1;
var typeArgs_tilde_slash = f<a, b> ~/ 1;
var operators_bang_openBracket = f(a<b,c>![d]);
var operators_bang_paren = f(a<b,c>!(d));
var operators_lessThan = f<a><b>;
var operators_minus = f(a<b,c>-d);
var operators_openBracket = f(a<b,c>[d]);
var operators_openBracket_error = f(a<b,c>[d]>e);
var operators_openBracket_unambiguous = f(a<b,c>[d, e]);
var[KeywordToken] typeArgs_ampersand[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] &[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_asterisk[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] *[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_bar[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] |[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_caret[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ^[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_closeBrace[StringToken] =[SimpleToken] {[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]}[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_closeBracket[StringToken] =[SimpleToken] [[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]][SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_closeParen[StringToken] =[SimpleToken] g[StringToken]([BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_colon[StringToken] =[SimpleToken] {[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]:[SimpleToken] null[KeywordToken]}[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_comma[StringToken] =[SimpleToken] [[BeginToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken],[SimpleToken] null[KeywordToken]][SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_equals[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ==[SimpleToken] null[KeywordToken];[SimpleToken]
var[KeywordToken] typeArgs_not_equals[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] !=[SimpleToken] null[KeywordToken];[SimpleToken]
var[KeywordToken] typeArgs_openParen[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_percent[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] %[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_period_methodInvocation[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_period_methodInvocation_generic[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]foo[StringToken]<[BeginToken]c[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_period_period[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]..[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_period_propertyAccess[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken].[SimpleToken]hashCode[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_plus[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] +[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_question[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ?[SimpleToken] null[KeywordToken] :[SimpleToken] null[KeywordToken];[SimpleToken]
var[KeywordToken] typeArgs_question_period_methodInvocation[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_question_period_methodInvocation_generic[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]foo[StringToken]<[BeginToken]c[StringToken]>[SimpleToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_question_period_period[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?..[SimpleToken]toString[StringToken]([BeginToken])[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_question_period_propertyAccess[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken]?.[SimpleToken]hashCode[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_question_question[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ??[SimpleToken] 0[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_semicolon[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] typeArgs_slash[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] /[SimpleToken] 1[StringToken];[SimpleToken]
var[KeywordToken] typeArgs_tilde_slash[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken] ~/[SimpleToken] 1[StringToken];[SimpleToken]
var[KeywordToken] operators_bang_openBracket[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]![SimpleToken][[BeginToken]d[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_bang_paren[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]![SimpleToken]([BeginToken]d[StringToken])[SimpleToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_lessThan[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken]>[SimpleToken]<[BeginToken]b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] operators_minus[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken]-[SimpleToken]d[StringToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_openBracket[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_openBracket_error[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken]][SimpleToken]>[SimpleToken]e[StringToken])[SimpleToken];[SimpleToken]
var[KeywordToken] operators_openBracket_unambiguous[StringToken] =[SimpleToken] f[StringToken]([BeginToken]a[StringToken]<[BeginToken]b[StringToken],[SimpleToken]c[StringToken]>[SimpleToken][[BeginToken]d[StringToken],[SimpleToken] e[StringToken]][SimpleToken])[SimpleToken];[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,8 @@
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE.md file.
var simpleIdentifier = f<a, b>;
var method = f().m<a, b>;
var prefixedIdentifier = prefix.f<a, b>;
var three_identifiers = prefix.ClassName.m<a, b>;

View file

@ -0,0 +1,115 @@
beginCompilationUnit(var)
beginMetadataStar(var)
endMetadataStar(0)
beginTopLevelMember(var)
beginFields()
handleNoType(var)
handleIdentifier(simpleIdentifier, topLevelVariableDeclaration)
beginFieldInitializer(=)
handleIdentifier(f, expression)
handleNoTypeArguments(<)
handleNoArguments(<)
handleSend(f, <)
beginTypeArguments(<)
handleIdentifier(a, typeReference)
handleNoTypeArguments(,)
handleType(a, null)
handleIdentifier(b, typeReference)
handleNoTypeArguments(>)
handleType(b, null)
endTypeArguments(2, <, >)
handleTypeArgumentApplication(<)
endFieldInitializer(=, ;)
endTopLevelFields(null, null, null, null, var, 1, var, ;)
endTopLevelDeclaration(var)
beginMetadataStar(var)
endMetadataStar(0)
beginTopLevelMember(var)
beginFields(;)
handleNoType(var)
handleIdentifier(method, topLevelVariableDeclaration)
beginFieldInitializer(=)
handleIdentifier(f, expression)
handleNoTypeArguments(()
beginArguments(()
endArguments(0, (, ))
handleSend(f, .)
handleIdentifier(m, expressionContinuation)
handleNoTypeArguments(<)
handleNoArguments(<)
handleSend(m, <)
handleEndingBinaryExpression(.)
beginTypeArguments(<)
handleIdentifier(a, typeReference)
handleNoTypeArguments(,)
handleType(a, null)
handleIdentifier(b, typeReference)
handleNoTypeArguments(>)
handleType(b, null)
endTypeArguments(2, <, >)
handleTypeArgumentApplication(<)
endFieldInitializer(=, ;)
endTopLevelFields(null, null, null, null, var, 1, var, ;)
endTopLevelDeclaration(var)
beginMetadataStar(var)
endMetadataStar(0)
beginTopLevelMember(var)
beginFields(;)
handleNoType(var)
handleIdentifier(prefixedIdentifier, topLevelVariableDeclaration)
beginFieldInitializer(=)
handleIdentifier(prefix, expression)
handleNoTypeArguments(.)
handleNoArguments(.)
handleSend(prefix, .)
handleIdentifier(f, expressionContinuation)
handleNoTypeArguments(<)
handleNoArguments(<)
handleSend(f, <)
handleEndingBinaryExpression(.)
beginTypeArguments(<)
handleIdentifier(a, typeReference)
handleNoTypeArguments(,)
handleType(a, null)
handleIdentifier(b, typeReference)
handleNoTypeArguments(>)
handleType(b, null)
endTypeArguments(2, <, >)
handleTypeArgumentApplication(<)
endFieldInitializer(=, ;)
endTopLevelFields(null, null, null, null, var, 1, var, ;)
endTopLevelDeclaration(var)
beginMetadataStar(var)
endMetadataStar(0)
beginTopLevelMember(var)
beginFields(;)
handleNoType(var)
handleIdentifier(three_identifiers, topLevelVariableDeclaration)
beginFieldInitializer(=)
handleIdentifier(prefix, expression)
handleNoTypeArguments(.)
handleNoArguments(.)
handleSend(prefix, .)
handleIdentifier(ClassName, expressionContinuation)
handleNoTypeArguments(.)
handleNoArguments(.)
handleSend(ClassName, .)
handleEndingBinaryExpression(.)
handleIdentifier(m, expressionContinuation)
handleNoTypeArguments(<)
handleNoArguments(<)
handleSend(m, <)
handleEndingBinaryExpression(.)
beginTypeArguments(<)
handleIdentifier(a, typeReference)
handleNoTypeArguments(,)
handleType(a, null)
handleIdentifier(b, typeReference)
handleNoTypeArguments(>)
handleType(b, null)
endTypeArguments(2, <, >)
handleTypeArgumentApplication(<)
endFieldInitializer(=, ;)
endTopLevelFields(null, null, null, null, var, 1, var, ;)
endTopLevelDeclaration()
endCompilationUnit(4, )

View file

@ -0,0 +1,206 @@
parseUnit(var)
skipErrorTokens(var)
listener: beginCompilationUnit(var)
syntheticPreviousToken(var)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(var)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(var)
parseFields(, null, null, null, null, null, var, var, Instance of 'NoType', simpleIdentifier, DeclarationKind.TopLevel, null, false)
listener: beginFields()
listener: handleNoType(var)
ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
listener: handleIdentifier(simpleIdentifier, topLevelVariableDeclaration)
parseFieldInitializerOpt(simpleIdentifier, simpleIdentifier, null, null, null, var, DeclarationKind.TopLevel, null)
listener: beginFieldInitializer(=)
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: beginTypeArguments(<)
listener: handleIdentifier(a, typeReference)
listener: handleNoTypeArguments(,)
listener: handleType(a, null)
listener: handleIdentifier(b, typeReference)
listener: handleNoTypeArguments(>)
listener: handleType(b, null)
listener: endTypeArguments(2, <, >)
listener: handleTypeArgumentApplication(<)
listener: endFieldInitializer(=, ;)
listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
listener: endTopLevelDeclaration(var)
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(var)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(var)
parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', method, DeclarationKind.TopLevel, null, false)
listener: beginFields(;)
listener: handleNoType(var)
ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
listener: handleIdentifier(method, topLevelVariableDeclaration)
parseFieldInitializerOpt(method, method, null, null, null, var, DeclarationKind.TopLevel, null)
listener: beginFieldInitializer(=)
parseExpression(=)
parsePrecedenceExpression(=, 1, true)
parseUnaryExpression(=, true)
parsePrimary(=, expression)
parseSendOrFunctionLiteral(=, expression)
looksLikeFunctionBody(.)
parseSend(=, expression)
isNextIdentifier(=)
ensureIdentifier(=, expression)
listener: handleIdentifier(f, expression)
listener: handleNoTypeArguments(()
parseArgumentsOpt(f)
parseArguments(f)
parseArgumentsRest(()
listener: beginArguments(()
listener: endArguments(0, (, ))
listener: handleSend(f, .)
parsePrimary(., expressionContinuation)
parseSendOrFunctionLiteral(., expressionContinuation)
parseSend(., expressionContinuation)
isNextIdentifier(.)
ensureIdentifier(., expressionContinuation)
listener: handleIdentifier(m, expressionContinuation)
listener: handleNoTypeArguments(<)
parseArgumentsOpt(m)
listener: handleNoArguments(<)
listener: handleSend(m, <)
listener: handleEndingBinaryExpression(.)
listener: beginTypeArguments(<)
listener: handleIdentifier(a, typeReference)
listener: handleNoTypeArguments(,)
listener: handleType(a, null)
listener: handleIdentifier(b, typeReference)
listener: handleNoTypeArguments(>)
listener: handleType(b, null)
listener: endTypeArguments(2, <, >)
listener: handleTypeArgumentApplication(<)
listener: endFieldInitializer(=, ;)
listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
listener: endTopLevelDeclaration(var)
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(var)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(var)
parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', prefixedIdentifier, DeclarationKind.TopLevel, null, false)
listener: beginFields(;)
listener: handleNoType(var)
ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
listener: handleIdentifier(prefixedIdentifier, topLevelVariableDeclaration)
parseFieldInitializerOpt(prefixedIdentifier, prefixedIdentifier, null, null, null, var, DeclarationKind.TopLevel, null)
listener: beginFieldInitializer(=)
parseExpression(=)
parsePrecedenceExpression(=, 1, true)
parseUnaryExpression(=, true)
parsePrimary(=, expression)
parseSendOrFunctionLiteral(=, expression)
parseSend(=, expression)
isNextIdentifier(=)
ensureIdentifier(=, expression)
listener: handleIdentifier(prefix, expression)
listener: handleNoTypeArguments(.)
parseArgumentsOpt(prefix)
listener: handleNoArguments(.)
listener: handleSend(prefix, .)
parsePrimary(., expressionContinuation)
parseSendOrFunctionLiteral(., expressionContinuation)
parseSend(., expressionContinuation)
isNextIdentifier(.)
ensureIdentifier(., expressionContinuation)
listener: handleIdentifier(f, expressionContinuation)
listener: handleNoTypeArguments(<)
parseArgumentsOpt(f)
listener: handleNoArguments(<)
listener: handleSend(f, <)
listener: handleEndingBinaryExpression(.)
listener: beginTypeArguments(<)
listener: handleIdentifier(a, typeReference)
listener: handleNoTypeArguments(,)
listener: handleType(a, null)
listener: handleIdentifier(b, typeReference)
listener: handleNoTypeArguments(>)
listener: handleType(b, null)
listener: endTypeArguments(2, <, >)
listener: handleTypeArgumentApplication(<)
listener: endFieldInitializer(=, ;)
listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
listener: endTopLevelDeclaration(var)
parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
parseMetadataStar(;)
listener: beginMetadataStar(var)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(;)
listener: beginTopLevelMember(var)
parseFields(;, null, null, null, null, null, var, var, Instance of 'NoType', three_identifiers, DeclarationKind.TopLevel, null, false)
listener: beginFields(;)
listener: handleNoType(var)
ensureIdentifierPotentiallyRecovered(var, topLevelVariableDeclaration, false)
listener: handleIdentifier(three_identifiers, topLevelVariableDeclaration)
parseFieldInitializerOpt(three_identifiers, three_identifiers, null, null, null, var, DeclarationKind.TopLevel, null)
listener: beginFieldInitializer(=)
parseExpression(=)
parsePrecedenceExpression(=, 1, true)
parseUnaryExpression(=, true)
parsePrimary(=, expression)
parseSendOrFunctionLiteral(=, expression)
parseSend(=, expression)
isNextIdentifier(=)
ensureIdentifier(=, expression)
listener: handleIdentifier(prefix, expression)
listener: handleNoTypeArguments(.)
parseArgumentsOpt(prefix)
listener: handleNoArguments(.)
listener: handleSend(prefix, .)
parsePrimary(., expressionContinuation)
parseSendOrFunctionLiteral(., expressionContinuation)
parseSend(., expressionContinuation)
isNextIdentifier(.)
ensureIdentifier(., expressionContinuation)
listener: handleIdentifier(ClassName, expressionContinuation)
listener: handleNoTypeArguments(.)
parseArgumentsOpt(ClassName)
listener: handleNoArguments(.)
listener: handleSend(ClassName, .)
listener: handleEndingBinaryExpression(.)
parsePrimary(., expressionContinuation)
parseSendOrFunctionLiteral(., expressionContinuation)
parseSend(., expressionContinuation)
isNextIdentifier(.)
ensureIdentifier(., expressionContinuation)
listener: handleIdentifier(m, expressionContinuation)
listener: handleNoTypeArguments(<)
parseArgumentsOpt(m)
listener: handleNoArguments(<)
listener: handleSend(m, <)
listener: handleEndingBinaryExpression(.)
listener: beginTypeArguments(<)
listener: handleIdentifier(a, typeReference)
listener: handleNoTypeArguments(,)
listener: handleType(a, null)
listener: handleIdentifier(b, typeReference)
listener: handleNoTypeArguments(>)
listener: handleType(b, null)
listener: endTypeArguments(2, <, >)
listener: handleTypeArgumentApplication(<)
listener: endFieldInitializer(=, ;)
listener: endTopLevelFields(null, null, null, null, var, 1, var, ;)
listener: endTopLevelDeclaration()
reportAllErrorTokens(var)
listener: endCompilationUnit(4, )

View file

@ -0,0 +1,11 @@
var simpleIdentifier = f<a, b>;
var method = f().m<a, b>;
var prefixedIdentifier = prefix.f<a, b>;
var three_identifiers = prefix.ClassName.m<a, b>;
var[KeywordToken] simpleIdentifier[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] method[StringToken] =[SimpleToken] f[StringToken]([BeginToken])[SimpleToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] prefixedIdentifier[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] three_identifiers[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]ClassName[StringToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,11 @@
var simpleIdentifier = f<a, b>;
var method = f().m<a, b>;
var prefixedIdentifier = prefix.f<a, b>;
var three_identifiers = prefix.ClassName.m<a, b>;
var[KeywordToken] simpleIdentifier[StringToken] =[SimpleToken] f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] method[StringToken] =[SimpleToken] f[StringToken]([BeginToken])[SimpleToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] prefixedIdentifier[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]f[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
var[KeywordToken] three_identifiers[StringToken] =[SimpleToken] prefix[StringToken].[SimpleToken]ClassName[StringToken].[SimpleToken]m[StringToken]<[BeginToken]a[StringToken],[SimpleToken] b[StringToken]>[SimpleToken];[SimpleToken]
[SimpleToken]

View file

@ -2209,4 +2209,9 @@ class ParserTestListener implements Listener {
void handleNoCommentReference() {
doPrint('handleNoCommentReference()');
}
void handleTypeArgumentApplication(Token openAngleBracket) {
seen(openAngleBracket);
doPrint('handleTypeArgumentApplication(' '$openAngleBracket)');
}
}

View file

@ -23,6 +23,7 @@ across
activated
adequate
adi
advantage
affecting
afterwards
agree
@ -300,6 +301,7 @@ degrades
degree
del
delimit
delimiting
demands
demangle
demangled
@ -333,6 +335,7 @@ dirtify
dirtifying
dirty
disallow
disambiguating
disambiguator
disjoint
dispatched
@ -611,6 +614,7 @@ ints
invariants
io
is64
isolated
issuecomment
issuing
iterables

View file

@ -42,6 +42,7 @@ arbitrarily
asdf
asserter
assure
asterisk
auth
authority
autobianchi
@ -145,6 +146,7 @@ collisions
columns
commented
commit
commits
companion
comparative
comparer
@ -497,11 +499,13 @@ local3h
logd
logs
loo
lookahead
loopback
mac
maker
matters
mds
meaningless
measured
method1d
metric
@ -541,6 +545,7 @@ noisy
nondefault
nonexisting
noo
noted
numerator
ob
obool
@ -642,6 +647,7 @@ regards
regenerate
regressions
reify
reject
reload
remap
remaps

View file

@ -2,16 +2,27 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/issue44347.dart:6:6: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// Set<int>.();
// ^
//
// pkg/front_end/testcases/general/issue44347.dart:6:13: Error: Expected an identifier, but got ')'.
// Try inserting an identifier before ')'.
// Set<int>.();
// ^
//
// pkg/front_end/testcases/general/issue44347.dart:6:12: Error: Expected an identifier, but got '('.
// Try inserting an identifier before '('.
// Set<int>.();
// ^
//
import self as self;
import "dart:collection" as col;
import "dart:core" as core;
static method test() → dynamic {
col::LinkedHashSet::•<core::int*>();
invalid-expression "pkg/front_end/testcases/general/issue44347.dart:6:12: Error: Expected an identifier, but got '('.
Try inserting an identifier before '('.
Set<int>.();
^";
}
static method main() → dynamic {}

View file

@ -2,16 +2,27 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/issue44347.dart:6:6: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// Set<int>.();
// ^
//
// pkg/front_end/testcases/general/issue44347.dart:6:13: Error: Expected an identifier, but got ')'.
// Try inserting an identifier before ')'.
// Set<int>.();
// ^
//
// pkg/front_end/testcases/general/issue44347.dart:6:12: Error: Expected an identifier, but got '('.
// Try inserting an identifier before '('.
// Set<int>.();
// ^
//
import self as self;
import "dart:collection" as col;
import "dart:core" as core;
static method test() → dynamic {
new col::_CompactLinkedHashSet::•<core::int*>();
invalid-expression "pkg/front_end/testcases/general/issue44347.dart:6:12: Error: Expected an identifier, but got '('.
Try inserting an identifier before '('.
Set<int>.();
^";
}
static method main() → dynamic {}

View file

@ -6,7 +6,7 @@
library test;
List<T> f<T>(T g()) => <T>[g()];
var v = (f<dynamic>)(/*@returnType=int**/() {
var v = (f<dynamic>)/*@typeArgs=int**/(/*@returnType=int**/() {
return 1;
});

View file

@ -1,5 +1,5 @@
// @dart = 2.9
library test;
List<T> f<T>(T g()) => <T>[g()];
var v = (f<dynamic>)( () { return 1; });
var v = (f<dynamic>) ( () { return 1; });
main() {}

View file

@ -2,34 +2,21 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:19: Error: A comparison expression can't be an operand of another comparison expression.
// Try putting parentheses around one of the comparisons.
// var v = (f<dynamic>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: Expected an identifier, but got ')'.
// Try inserting an identifier before ')'.
// var v = (f<dynamic>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
// - 'List' is from 'dart:core'.
// Try correcting the operator to an existing operator, or defining a '<' operator.
// var v = (f<dynamic>)(/*@returnType=int**/() {
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var v = (f<dynamic>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
static field dynamic v = invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
- 'List' is from 'dart:core'.
Try correcting the operator to an existing operator, or defining a '<' operator.
var v = (f<dynamic>)(/*@returnType=int**/() {
^"{dynamic}.>(invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: This couldn't be parsed.
var v = (f<dynamic>)(/*@returnType=int**/() {
^"){dynamic}.call(() → core::int* {
static field core::List<core::int*>* v = (#C1)<core::int*>(() → core::int* {
return 1;
});
}){(() →* core::int*) →* core::List<core::int*>*};
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
return <self::f::T*>[g(){() →* self::f::T*}];
static method main() → dynamic {}
constants {
#C1 = tearoff self::f
}

View file

@ -2,20 +2,15 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:19: Error: A comparison expression can't be an operand of another comparison expression.
// Try putting parentheses around one of the comparisons.
// var v = (f<dynamic>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: Expected an identifier, but got ')'.
// Try inserting an identifier before ')'.
// var v = (f<dynamic>)(/*@returnType=int**/() {
// ^
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var v = (f<dynamic>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
static field dynamic v;
static field core::List<core::int*>* v;
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
;
static method main() → dynamic

View file

@ -2,34 +2,21 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:19: Error: A comparison expression can't be an operand of another comparison expression.
// Try putting parentheses around one of the comparisons.
// var v = (f<dynamic>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: Expected an identifier, but got ')'.
// Try inserting an identifier before ')'.
// var v = (f<dynamic>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
// - 'List' is from 'dart:core'.
// Try correcting the operator to an existing operator, or defining a '<' operator.
// var v = (f<dynamic>)(/*@returnType=int**/() {
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var v = (f<dynamic>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
static field dynamic v = invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
- 'List' is from 'dart:core'.
Try correcting the operator to an existing operator, or defining a '<' operator.
var v = (f<dynamic>)(/*@returnType=int**/() {
^"{dynamic}.>(invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1.dart:9:20: Error: This couldn't be parsed.
var v = (f<dynamic>)(/*@returnType=int**/() {
^"){dynamic}.call(() → core::int* {
static field core::List<core::int*>* v = (#C1)<core::int*>(() → core::int* {
return 1;
});
}){(() →* core::int*) →* core::List<core::int*>*};
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
return core::_GrowableList::_literal1<self::f::T*>(g(){() →* self::f::T*});
static method main() → dynamic {}
constants {
#C1 = tearoff self::f
}

View file

@ -6,7 +6,7 @@
library test;
List<T> f<T>(T g()) => <T>[g()];
var v = (f<int>)(/*@returnType=int**/() {
var v = (f<int>)/*@typeArgs=int**/(/*@returnType=int**/() {
return 1;
});

View file

@ -1,5 +1,5 @@
// @dart = 2.9
library test;
List<T> f<T>(T g()) => <T>[g()];
var v = (f<int>)( () { return 1; });
var v = (f<int>) ( () { return 1; });
main() {}

View file

@ -2,34 +2,21 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:15: Error: A comparison expression can't be an operand of another comparison expression.
// Try putting parentheses around one of the comparisons.
// var v = (f<int>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: Expected an identifier, but got ')'.
// Try inserting an identifier before ')'.
// var v = (f<int>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
// - 'List' is from 'dart:core'.
// Try correcting the operator to an existing operator, or defining a '<' operator.
// var v = (f<int>)(/*@returnType=int**/() {
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var v = (f<int>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
static field dynamic v = invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
- 'List' is from 'dart:core'.
Try correcting the operator to an existing operator, or defining a '<' operator.
var v = (f<int>)(/*@returnType=int**/() {
^"{dynamic}.>(invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: This couldn't be parsed.
var v = (f<int>)(/*@returnType=int**/() {
^"){dynamic}.call(() → core::int* {
static field core::List<core::int*>* v = (#C1)<core::int*>(() → core::int* {
return 1;
});
}){(() →* core::int*) →* core::List<core::int*>*};
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
return <self::f::T*>[g(){() →* self::f::T*}];
static method main() → dynamic {}
constants {
#C1 = tearoff self::f
}

View file

@ -2,20 +2,15 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:15: Error: A comparison expression can't be an operand of another comparison expression.
// Try putting parentheses around one of the comparisons.
// var v = (f<int>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: Expected an identifier, but got ')'.
// Try inserting an identifier before ')'.
// var v = (f<int>)(/*@returnType=int**/() {
// ^
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var v = (f<int>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
static field dynamic v;
static field core::List<core::int*>* v;
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
;
static method main() → dynamic

View file

@ -2,34 +2,21 @@ library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:15: Error: A comparison expression can't be an operand of another comparison expression.
// Try putting parentheses around one of the comparisons.
// var v = (f<int>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: Expected an identifier, but got ')'.
// Try inserting an identifier before ')'.
// var v = (f<int>)(/*@returnType=int**/() {
// ^
//
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
// - 'List' is from 'dart:core'.
// Try correcting the operator to an existing operator, or defining a '<' operator.
// var v = (f<int>)(/*@returnType=int**/() {
// pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var v = (f<int>)/*@typeArgs=int**/(/*@returnType=int**/() {
// ^
//
import self as self;
import "dart:core" as core;
static field dynamic v = invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:11: Error: The operator '<' isn't defined for the class 'List<T> Function<T>(T Function())'.
- 'List' is from 'dart:core'.
Try correcting the operator to an existing operator, or defining a '<' operator.
var v = (f<int>)(/*@returnType=int**/() {
^"{dynamic}.>(invalid-expression "pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1.dart:9:16: Error: This couldn't be parsed.
var v = (f<int>)(/*@returnType=int**/() {
^"){dynamic}.call(() → core::int* {
static field core::List<core::int*>* v = (#C1)<core::int*>(() → core::int* {
return 1;
});
}){(() →* core::int*) →* core::List<core::int*>*};
static method f<T extends core::Object* = dynamic>(() →* self::f::T* g) → core::List<self::f::T*>*
return core::_GrowableList::_literal1<self::f::T*>(g(){() →* self::f::T*});
static method main() → dynamic {}
constants {
#C1 = tearoff self::f
}

View file

@ -1,4 +1,3 @@
// @dart = 2.9
main() {}
type T = Map<A, B;
>
type T = Map<A, B> ;

View file

@ -2,11 +2,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: Expected ';' after this.
// type T = Map<A, B>
// ^
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected a declaration, but got '>'.
// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected ';' after this.
// type T = Map<A, B>
// ^
//
@ -18,22 +14,25 @@ library;
// type T = Map<A, B>
// ^^^^
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:14: Error: Getter not found: 'A'.
// pkg/front_end/testcases/regress/issue_31188.dart:7:14: Error: 'A' isn't a type.
// type T = Map<A, B>
// ^
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: The operator '<' isn't defined for the class 'Type'.
// - 'Type' is from 'dart:core'.
// Try correcting the operator to an existing operator, or defining a '<' operator.
// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: 'B' isn't a type.
// type T = Map<A, B>
// ^
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// type T = Map<A, B>
// ^
//
import self as self;
import "dart:core" as core;
static field invalid-type T = invalid-expression "pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: The operator '<' isn't defined for the class 'Type'.
- 'Type' is from 'dart:core'.
Try correcting the operator to an existing operator, or defining a '<' operator.
type T = Map<A, B>
^";
static field invalid-type B;
static field invalid-type T = #C1;
static method main() → dynamic {}
constants {
#C1 = TypeLiteralConstant(core::Map<dynamic, dynamic>*)
}

View file

@ -2,11 +2,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: Expected ';' after this.
// type T = Map<A, B>
// ^
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected a declaration, but got '>'.
// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected ';' after this.
// type T = Map<A, B>
// ^
//
@ -17,6 +13,5 @@ library;
import self as self;
static field invalid-type T;
static field invalid-type B;
static method main() → dynamic
;

View file

@ -2,11 +2,7 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: Expected ';' after this.
// type T = Map<A, B>
// ^
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected a declaration, but got '>'.
// pkg/front_end/testcases/regress/issue_31188.dart:7:18: Error: Expected ';' after this.
// type T = Map<A, B>
// ^
//
@ -18,22 +14,25 @@ library;
// type T = Map<A, B>
// ^^^^
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:14: Error: Getter not found: 'A'.
// pkg/front_end/testcases/regress/issue_31188.dart:7:14: Error: 'A' isn't a type.
// type T = Map<A, B>
// ^
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: The operator '<' isn't defined for the class 'Type'.
// - 'Type' is from 'dart:core'.
// Try correcting the operator to an existing operator, or defining a '<' operator.
// pkg/front_end/testcases/regress/issue_31188.dart:7:17: Error: 'B' isn't a type.
// type T = Map<A, B>
// ^
//
// pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// type T = Map<A, B>
// ^
//
import self as self;
import "dart:core" as core;
static field invalid-type T = invalid-expression "pkg/front_end/testcases/regress/issue_31188.dart:7:13: Error: The operator '<' isn't defined for the class 'Type'.
- 'Type' is from 'dart:core'.
Try correcting the operator to an existing operator, or defining a '<' operator.
type T = Map<A, B>
^";
static field invalid-type B;
static field invalid-type T = #C1;
static method main() → dynamic {}
constants {
#C1 = TypeLiteralConstant(core::Map<dynamic, dynamic>*)
}

View file

@ -12,6 +12,11 @@ library;
// var c2 = new C.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:20:13: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var c3 = C<String>.bar<int>();
// ^
//
// pkg/front_end/testcases/regress/issue_34403.dart:20:22: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// var c3 = C<String>.bar<int>();
@ -32,6 +37,11 @@ library;
// const d2 = const D.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:29:15: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// const d3 = D<String>.foo<int>();
// ^
//
// pkg/front_end/testcases/regress/issue_34403.dart:29:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// const d3 = D<String>.foo<int>();
@ -52,6 +62,11 @@ library;
// var e2 = new p.E.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:38:15: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var e3 = p.E<String>.bar<int>();
// ^
//
// pkg/front_end/testcases/regress/issue_34403.dart:38:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// var e3 = p.E<String>.bar<int>();
@ -72,6 +87,11 @@ library;
// const f2 = const p.F.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:47:17: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// const f3 = p.F<String>.foo<int>();
// ^
//
// pkg/front_end/testcases/regress/issue_34403.dart:47:26: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// const f3 = p.F<String>.foo<int>();
@ -123,25 +143,25 @@ static method main() → dynamic {
c1.{self::C::toString}(){() →* core::String*};
self::C<core::int*>* c2 = new self::C::bar<core::int*>();
c2.{self::C::toString}(){() →* core::String*};
self::C<core::String*>* c3 = new self::C::bar<core::String*>();
self::C<core::int*>* c3 = new self::C::bar<core::int*>();
c3.{self::C::toString}(){() →* core::String*};
self::C<core::String*>* c4 = new self::C::bar<core::String*>();
c4.{self::C::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
(#C2).{self::D::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
(#C2).{self::D::toString}(){() →* core::String*};
iss::E<core::int*>* e1 = new iss::E::bar<core::int*>();
e1.{iss::E::toString}(){() →* core::String*};
iss::E<dynamic>* e2 = new iss::E::bar<dynamic>();
e2.{iss::E::toString}(){() →* core::String*};
iss::E<core::String*>* e3 = new iss::E::bar<core::String*>();
iss::E<core::int*>* e3 = new iss::E::bar<core::int*>();
e3.{iss::E::toString}(){() →* core::String*};
iss::E<core::String*>* e4 = new iss::E::bar<core::String*>();
e4.{iss::E::toString}(){() →* core::String*};
(#C3).{iss::F::toString}(){() →* core::String*};
(#C4).{iss::F::toString}(){() →* core::String*};
(#C5).{iss::F::toString}(){() →* core::String*};
(#C3).{iss::F::toString}(){() →* core::String*};
(#C5).{iss::F::toString}(){() →* core::String*};
}

View file

@ -12,6 +12,11 @@ library;
// var c2 = new C.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:20:13: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var c3 = C<String>.bar<int>();
// ^
//
// pkg/front_end/testcases/regress/issue_34403.dart:20:22: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// var c3 = C<String>.bar<int>();
@ -32,6 +37,11 @@ library;
// const d2 = const D.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:29:15: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// const d3 = D<String>.foo<int>();
// ^
//
// pkg/front_end/testcases/regress/issue_34403.dart:29:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// const d3 = D<String>.foo<int>();
@ -52,6 +62,11 @@ library;
// var e2 = new p.E.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:38:15: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// var e3 = p.E<String>.bar<int>();
// ^
//
// pkg/front_end/testcases/regress/issue_34403.dart:38:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// var e3 = p.E<String>.bar<int>();
@ -72,6 +87,11 @@ library;
// const f2 = const p.F.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:47:17: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
// const f3 = p.F<String>.foo<int>();
// ^
//
// pkg/front_end/testcases/regress/issue_34403.dart:47:26: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// const f3 = p.F<String>.foo<int>();
@ -123,25 +143,25 @@ static method main() → dynamic {
c1.{self::C::toString}(){() →* core::String*};
self::C<core::int*>* c2 = new self::C::bar<core::int*>();
c2.{self::C::toString}(){() →* core::String*};
self::C<core::String*>* c3 = new self::C::bar<core::String*>();
self::C<core::int*>* c3 = new self::C::bar<core::int*>();
c3.{self::C::toString}(){() →* core::String*};
self::C<core::String*>* c4 = new self::C::bar<core::String*>();
c4.{self::C::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
(#C2).{self::D::toString}(){() →* core::String*};
(#C1).{self::D::toString}(){() →* core::String*};
(#C2).{self::D::toString}(){() →* core::String*};
iss::E<core::int*>* e1 = new iss::E::bar<core::int*>();
e1.{iss::E::toString}(){() →* core::String*};
iss::E<dynamic>* e2 = new iss::E::bar<dynamic>();
e2.{iss::E::toString}(){() →* core::String*};
iss::E<core::String*>* e3 = new iss::E::bar<core::String*>();
iss::E<core::int*>* e3 = new iss::E::bar<core::int*>();
e3.{iss::E::toString}(){() →* core::String*};
iss::E<core::String*>* e4 = new iss::E::bar<core::String*>();
e4.{iss::E::toString}(){() →* core::String*};
(#C3).{iss::F::toString}(){() →* core::String*};
(#C4).{iss::F::toString}(){() →* core::String*};
(#C5).{iss::F::toString}(){() →* core::String*};
(#C3).{iss::F::toString}(){() →* core::String*};
(#C5).{iss::F::toString}(){() →* core::String*};
}

View file

@ -92,12 +92,13 @@ main() {
Foo<int>();
Foo<int>.bar();
Foo<int>.bar.baz();
// ^^^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
// [cfe] Expected '(' after this.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// [cfe] The method 'baz' isn't defined for the class 'Foo<int>'.
//^^^
// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION
// ^^^^^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the 'constructor-tearoffs' language feature to be enabled.
// ^
// [cfe] Getter not found: 'bar'.
Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.

View file

@ -94,12 +94,13 @@ main() {
Foo<int>();
Foo<int>.bar();
Foo<int>.bar.baz();
// ^^^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
// [cfe] Expected '(' after this.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// [cfe] The method 'baz' isn't defined for the class 'Foo<int>'.
//^^^
// [analyzer] COMPILE_TIME_ERROR.INVOCATION_OF_NON_FUNCTION_EXPRESSION
// ^^^^^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the 'constructor-tearoffs' language feature to be enabled.
// ^
// [cfe] Getter not found: 'bar'.
Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.