[cfe] Add error on misplaced type arguments in constructor tear-offs

Closes #46890.

Bug: https://github.com/dart-lang/sdk/issues/46890
Change-Id: Idf0c4e5ef6380541aaccba9f74755572b2fa9549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210460
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Dmitry Stefantsov 2021-08-23 14:36:47 +00:00 committed by commit-bot@chromium.org
parent b977476ca0
commit d3c3e92740
20 changed files with 522 additions and 144 deletions

View file

@ -1755,6 +1755,18 @@ const MessageCode messageConstructorNotSync = const MessageCode(
message:
r"""Constructor bodies can't use 'async', 'async*', or 'sync*'.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeConstructorTearOffWithTypeArguments =
messageConstructorTearOffWithTypeArguments;
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageConstructorTearOffWithTypeArguments = const MessageCode(
"ConstructorTearOffWithTypeArguments",
message:
r"""A constructor tear-off can't have type arguments after the constructor name.""",
tip:
r"""Try removing the type arguments or placing them after the class name.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeConstructorWithReturnType =
messageConstructorWithReturnType;
@ -1775,8 +1787,9 @@ const MessageCode messageConstructorWithTypeArguments = const MessageCode(
"ConstructorWithTypeArguments",
analyzerCodes: <String>["WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR"],
message:
r"""A constructor invocation can't have type arguments on the constructor name.""",
tip: r"""Try to place the type arguments on the class name.""");
r"""A constructor invocation can't have type arguments after the constructor name.""",
tip:
r"""Try removing the type arguments or placing them after the class name.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeConstructorWithTypeParameters =

View file

@ -6365,6 +6365,11 @@ class BodyBuilder extends ScopeListener<JumpTarget>
if (operand is Generator) {
push(operand.applyTypeArguments(
openAngleBracket.charOffset, typeArguments));
} else if (operand is StaticTearOff && operand.target.isFactory ||
operand is ConstructorTearOff ||
operand is RedirectingFactoryTearOff) {
push(buildProblem(fasta.messageConstructorTearOffWithTypeArguments,
openAngleBracket.charOffset, noLength));
} else {
push(new Instantiation(
toValue(operand), buildDartTypeArguments(typeArguments))

View file

@ -150,6 +150,7 @@ ConstEvalZeroDivisor/example: Fail
ConstFieldWithoutInitializer/example: Fail
ConstructorNotFound/example: Fail
ConstructorNotSync/example: Fail
ConstructorTearOffWithTypeArguments/analyzerCode: Fail
ContinueLabelNotTarget/example: Fail
ContinueOutsideOfLoop/part_wrapped_script1: Fail
ContinueOutsideOfLoop/script1: Fail

View file

@ -1625,8 +1625,8 @@ ConstructorWithTypeParameters:
}
ConstructorWithTypeArguments:
template: "A constructor invocation can't have type arguments on the constructor name."
tip: "Try to place the type arguments on the class name."
template: "A constructor invocation can't have type arguments after the constructor name."
tip: "Try removing the type arguments or placing them after the class name."
analyzerCode: WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
script:
- "class C<X> { C.foo(); } bar() { new C.foo<int>(); }"
@ -5262,3 +5262,11 @@ StaticTearOffFromInstantiatedClass:
script: |
class A<X> { static f() {} }
main() => A<int>.f;
ConstructorTearOffWithTypeArguments:
template: "A constructor tear-off can't have type arguments after the constructor name."
tip: "Try removing the type arguments or placing them after the class name."
experiments: constructor-tearoffs
script:
- "class C<X> { C.foo(); } bar() { C.foo<int>; }"

View file

@ -0,0 +1,28 @@
// 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.
class A<X> {
A.foo() {}
factory A.bar() => new A.foo();
factory A.baz() = A.bar;
}
test() {
List.filled; // Ok.
A.foo; // Ok.
A.bar; // Ok.
A.baz; // Ok.
List<int>.filled; // Ok.
A<int>.foo; // Ok.
A<int>.bar; // Ok.
A<int>.baz; // Ok.
List.filled<int>; // Error.
A.foo<int>; // Error.
A.bar<int>; // Error.
A.baz<int>; // Error.
}
main() {}

View file

@ -0,0 +1,74 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:22:14: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// List.filled<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:23:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.foo<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:24:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.bar<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:25:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.baz<int>; // Error.
// ^
//
import self as self;
import "dart:core" as core;
class A<X extends core::Object? = dynamic> extends core::Object {
static final field dynamic _redirecting# = <dynamic>[self::A::baz]/*isLegacy*/;
constructor foo() → self::A<self::A::X%>
: super core::Object::•() {}
static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
return new self::A::foo<self::A::bar::X%>();
static factory baz<X extends core::Object? = dynamic>() → self::A<self::A::baz::X%>
return self::A::bar<self::A::baz::X%>();
}
static method test() → dynamic {
#C1;
#C2;
#C3;
#C4;
#C5;
#C6;
#C7;
#C8;
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:22:14: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
List.filled<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:23:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.foo<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:24:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.bar<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:25:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.baz<int>; // Error.
^";
}
static method main() → dynamic {}
constants {
#C1 = static-tearoff core::List::filled
#C2 = constructor-tearoff self::A::foo
#C3 = static-tearoff self::A::bar
#C4 = redirecting-factory-tearoff self::A::baz
#C5 = instantiation core::List::filled <core::int>
#C6 = instantiation self::A::foo <core::int>
#C7 = instantiation self::A::bar <core::int>
#C8 = instantiation self::A::baz <core::int>
}

View file

@ -0,0 +1,74 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:22:14: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// List.filled<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:23:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.foo<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:24:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.bar<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:25:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.baz<int>; // Error.
// ^
//
import self as self;
import "dart:core" as core;
class A<X extends core::Object? = dynamic> extends core::Object {
static final field dynamic _redirecting# = <dynamic>[self::A::baz]/*isLegacy*/;
constructor foo() → self::A<self::A::X%>
: super core::Object::•() {}
static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
return new self::A::foo<self::A::bar::X%>();
static factory baz<X extends core::Object? = dynamic>() → self::A<self::A::baz::X%>
return self::A::bar<self::A::baz::X%>();
}
static method test() → dynamic {
#C1;
#C2;
#C3;
#C4;
#C5;
#C6;
#C7;
#C8;
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:22:14: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
List.filled<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:23:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.foo<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:24:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.bar<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:25:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.baz<int>; // Error.
^";
}
static method main() → dynamic {}
constants {
#C1 = static-tearoff core::List::filled
#C2 = constructor-tearoff self::A::foo
#C3 = static-tearoff self::A::bar
#C4 = redirecting-factory-tearoff self::A::baz
#C5 = instantiation core::List::filled <core::int>
#C6 = instantiation self::A::foo <core::int>
#C7 = instantiation self::A::bar <core::int>
#C8 = instantiation self::A::baz <core::int>
}

View file

@ -0,0 +1,8 @@
class A<X> {
A.foo() {}
factory A.bar() => new A.foo();
factory A.baz() = A.bar;
}
test() {}
main() {}

View file

@ -0,0 +1,8 @@
class A<X> {
A.foo() {}
factory A.bar() => new A.foo();
factory A.baz() = A.bar;
}
main() {}
test() {}

View file

@ -0,0 +1,74 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:22:14: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// List.filled<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:23:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.foo<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:24:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.bar<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:25:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.baz<int>; // Error.
// ^
//
import self as self;
import "dart:core" as core;
class A<X extends core::Object? = dynamic> extends core::Object {
static final field dynamic _redirecting# = <dynamic>[self::A::baz]/*isLegacy*/;
constructor foo() → self::A<self::A::X%>
: super core::Object::•() {}
static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
return new self::A::foo<self::A::bar::X%>();
static factory baz<X extends core::Object? = dynamic>() → self::A<self::A::baz::X%>
return self::A::bar<self::A::baz::X%>();
}
static method test() → dynamic {
#C1;
#C2;
#C3;
#C4;
#C5;
#C6;
#C7;
#C8;
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:22:14: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
List.filled<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:23:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.foo<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:24:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.bar<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:25:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.baz<int>; // Error.
^";
}
static method main() → dynamic {}
constants {
#C1 = static-tearoff core::List::filled
#C2 = constructor-tearoff self::A::foo
#C3 = static-tearoff self::A::bar
#C4 = redirecting-factory-tearoff self::A::baz
#C5 = instantiation core::List::filled <core::int*>
#C6 = instantiation self::A::foo <core::int*>
#C7 = instantiation self::A::bar <core::int*>
#C8 = instantiation self::A::baz <core::int*>
}

View file

@ -0,0 +1,17 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
class A<X extends core::Object? = dynamic> extends core::Object {
static final field dynamic _redirecting# = <dynamic>[self::A::baz]/*isLegacy*/;
constructor foo() → self::A<self::A::X%>
;
static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
;
static factory baz<X extends core::Object? = dynamic>() → self::A<self::A::baz::X%>
return self::A::bar<self::A::baz::X%>();
}
static method test() → dynamic
;
static method main() → dynamic
;

View file

@ -0,0 +1,74 @@
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:22:14: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// List.filled<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:23:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.foo<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:24:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.bar<int>; // Error.
// ^
//
// pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:25:8: Error: A constructor tear-off can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// A.baz<int>; // Error.
// ^
//
import self as self;
import "dart:core" as core;
class A<X extends core::Object? = dynamic> extends core::Object {
static final field dynamic _redirecting# = <dynamic>[self::A::baz]/*isLegacy*/;
constructor foo() → self::A<self::A::X%>
: super core::Object::•() {}
static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
return new self::A::foo<self::A::bar::X%>();
static factory baz<X extends core::Object? = dynamic>() → self::A<self::A::baz::X%>
return self::A::bar<self::A::baz::X%>();
}
static method test() → dynamic {
#C1;
#C2;
#C3;
#C4;
#C5;
#C6;
#C7;
#C8;
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:22:14: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
List.filled<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:23:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.foo<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:24:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.bar<int>; // Error.
^";
invalid-expression "pkg/front_end/testcases/constructor_tearoffs/issue46890.dart:25:8: Error: A constructor tear-off can't have type arguments after the constructor name.
Try removing the type arguments or placing them after the class name.
A.baz<int>; // Error.
^";
}
static method main() → dynamic {}
constants {
#C1 = static-tearoff core::List::filled
#C2 = constructor-tearoff self::A::foo
#C3 = static-tearoff self::A::bar
#C4 = redirecting-factory-tearoff self::A::baz
#C5 = instantiation core::List::filled <core::int*>
#C6 = instantiation self::A::foo <core::int*>
#C7 = instantiation self::A::bar <core::int*>
#C8 = instantiation self::A::baz <core::int*>
}

View file

@ -2,13 +2,13 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/regress/issue_34403.dart:16:14: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:16:14: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var c1 = C.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:18:18: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:18:18: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var c2 = new C.bar<int>();
// ^^^
//
@ -17,23 +17,23 @@ library;
// 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.
// pkg/front_end/testcases/regress/issue_34403.dart:20:22: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var c3 = C<String>.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:22:26: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:22:26: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var c4 = new C<String>.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:25:16: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:25:16: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const d1 = D.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:27:22: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:27:22: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const d2 = const D.foo<int>();
// ^^^
//
@ -42,23 +42,23 @@ library;
// 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.
// pkg/front_end/testcases/regress/issue_34403.dart:29:24: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const d3 = D<String>.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:31:30: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:31:30: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const d4 = const D<String>.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:34:16: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:34:16: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var e1 = p.E.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:36:20: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:36:20: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var e2 = new p.E.bar<int>();
// ^^^
//
@ -67,23 +67,23 @@ library;
// 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.
// pkg/front_end/testcases/regress/issue_34403.dart:38:24: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var e3 = p.E<String>.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:40:28: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:40:28: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var e4 = new p.E<String>.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:43:18: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:43:18: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const f1 = p.F.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:45:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:45:24: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const f2 = const p.F.foo<int>();
// ^^^
//
@ -92,13 +92,13 @@ library;
// 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.
// pkg/front_end/testcases/regress/issue_34403.dart:47:26: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const f3 = p.F<String>.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:49:32: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:49:32: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const f4 = const p.F<String>.foo<int>();
// ^^^
//

View file

@ -2,13 +2,13 @@ library;
//
// Problems in library:
//
// pkg/front_end/testcases/regress/issue_34403.dart:16:14: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:16:14: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var c1 = C.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:18:18: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:18:18: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var c2 = new C.bar<int>();
// ^^^
//
@ -17,23 +17,23 @@ library;
// 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.
// pkg/front_end/testcases/regress/issue_34403.dart:20:22: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var c3 = C<String>.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:22:26: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:22:26: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var c4 = new C<String>.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:25:16: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:25:16: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const d1 = D.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:27:22: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:27:22: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const d2 = const D.foo<int>();
// ^^^
//
@ -42,23 +42,23 @@ library;
// 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.
// pkg/front_end/testcases/regress/issue_34403.dart:29:24: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const d3 = D<String>.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:31:30: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:31:30: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const d4 = const D<String>.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:34:16: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:34:16: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var e1 = p.E.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:36:20: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:36:20: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var e2 = new p.E.bar<int>();
// ^^^
//
@ -67,23 +67,23 @@ library;
// 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.
// pkg/front_end/testcases/regress/issue_34403.dart:38:24: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var e3 = p.E<String>.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:40:28: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:40:28: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// var e4 = new p.E<String>.bar<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:43:18: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:43:18: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const f1 = p.F.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:45:24: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:45:24: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const f2 = const p.F.foo<int>();
// ^^^
//
@ -92,13 +92,13 @@ library;
// 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.
// pkg/front_end/testcases/regress/issue_34403.dart:47:26: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const f3 = p.F<String>.foo<int>();
// ^^^
//
// pkg/front_end/testcases/regress/issue_34403.dart:49:32: Error: A constructor invocation can't have type arguments on the constructor name.
// Try to place the type arguments on the class name.
// pkg/front_end/testcases/regress/issue_34403.dart:49:32: Error: A constructor invocation can't have type arguments after the constructor name.
// Try removing the type arguments or placing them after the class name.
// const f4 = const p.F<String>.foo<int>();
// ^^^
//

View file

@ -22,7 +22,7 @@ void main() {
// 'Class.named' is not a type:
new Class.named<int>().value;
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
@ -30,7 +30,7 @@ void main() {
new Class<int>.named<int>().value;
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
new prefix.Class().value;
// 'prefix' is not a type:
@ -46,7 +46,7 @@ void main() {
// [cfe] Method not found: 'prefix.Class'.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
new prefix.Class.named().value;
// 'prefix<int>.Class.named' doesn't fit the grammar syntax T.id:
@ -65,7 +65,7 @@ void main() {
new prefix.Class.named<int>().value;
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// 'prefix<int>.Class<int>' doesn't fit the grammar syntax T.id:
new prefix<int>.Class<int>.named().value;
@ -74,7 +74,7 @@ void main() {
// [cfe] Method not found: 'prefix.Class'.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// 'prefix<int>.Class.named<int>' doesn't fit the grammar syntax T.id:
@ -91,7 +91,7 @@ void main() {
new prefix.Class<int>.named<int>().value;
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// 'prefix<int>.Class<int>.named<int>' doesn't fit the grammar syntax T.id:
new prefix<int>.Class<int>.named<int>().value;
@ -100,5 +100,5 @@ void main() {
// [cfe] Method not found: 'prefix.Class'.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
}

View file

@ -27,14 +27,14 @@ main() {
// [cfe] The method 'baz' isn't defined for the class 'Foo<int>'.
new Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
new Foo.bar<int>.baz();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^
// [cfe] Method not found: 'Foo.bar.baz'.
new Foo.bar.baz<int>();
@ -42,8 +42,7 @@ main() {
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// [cfe] Method not found: 'Foo.bar.baz'.
const Foo();
@ -64,14 +63,14 @@ main() {
// [cfe] The method 'baz' isn't defined for the class 'Foo<int>'.
const Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
const Foo.bar<int>.baz();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^
// [cfe] Method not found: 'Foo.bar.baz'.
const Foo.bar.baz<int>();
@ -79,42 +78,41 @@ main() {
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// [cfe] Method not found: 'Foo.bar.baz'.
Foo();
Foo.bar();
Foo.bar.baz();
// ^^^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// ^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
Foo<int>();
Foo<int>.bar();
Foo<int>.bar.baz();
// ^^^^^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the 'constructor-tearoffs' language feature to be enabled.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// ^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
Foo.bar<int>.baz();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
//^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^
// [cfe] Method not found: 'Foo.bar.baz'.
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^
// [cfe] Method not found: 'Foo.bar.baz'.
Foo.bar.baz<int>();
// ^^^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// ^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
}

View file

@ -28,28 +28,27 @@ class C1 implements C {
abstract class D2 extends C with T {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] Can't use 'Object' as a mixin because it has constructors.
abstract class D3 implements T {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] 'Object' can't be used in both 'extends' and 'implements' clauses.
abstract class D4 = C with T;
// ^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] Can't use 'Object' as a mixin because it has constructors.
main() {
T.named();
// ^^^^^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] Method not found: 'Object.named'.
T.staticMethod<T>();
// ^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// [cfe] Method not found: 'Object.staticMethod'.
// ^^^^^^^^^^^^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
}

View file

@ -25,28 +25,27 @@ class C1 implements C {
abstract class D2 extends C with T {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] Can't use 'Object' as a mixin because it has constructors.
abstract class D3 implements T {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] 'Object' can't be used in both 'extends' and 'implements' clauses.
abstract class D4 = C with T;
// ^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] Can't use 'Object' as a mixin because it has constructors.
main() {
T.named();
// ^^^^^
// [analyzer] unspecified
// [cfe] unspecified
// [cfe] Method not found: 'Object.named'.
T.staticMethod<T>();
// ^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// [cfe] Method not found: 'Object.staticMethod'.
// ^^^^^^^^^^^^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
}

View file

@ -24,7 +24,7 @@ void main() {
// 'Class.named' is not a type:
new Class.named<int>().value;
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
@ -32,7 +32,7 @@ void main() {
new Class<int>.named<int>().value;
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
new prefix.Class().value;
// 'prefix' is not a type:
@ -48,7 +48,7 @@ void main() {
// [cfe] Method not found: 'prefix.Class'.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
new prefix.Class.named().value;
// 'prefix<int>.Class.named' doesn't fit the grammar syntax T.id:
@ -67,7 +67,7 @@ void main() {
new prefix.Class.named<int>().value;
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// 'prefix<int>.Class<int>' doesn't fit the grammar syntax T.id:
new prefix<int>.Class<int>.named().value;
@ -76,7 +76,7 @@ void main() {
// [cfe] Method not found: 'prefix.Class'.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// 'prefix<int>.Class.named<int>' doesn't fit the grammar syntax T.id:
@ -93,7 +93,7 @@ void main() {
new prefix.Class<int>.named<int>().value;
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// 'prefix<int>.Class<int>.named<int>' doesn't fit the grammar syntax T.id:
new prefix<int>.Class<int>.named<int>().value;
@ -102,5 +102,5 @@ void main() {
// [cfe] Method not found: 'prefix.Class'.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
}

View file

@ -29,14 +29,14 @@ main() {
// [cfe] The method 'baz' isn't defined for the class 'Foo<int>'.
new Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
new Foo.bar<int>.baz();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^
// [cfe] Method not found: 'Foo.bar.baz'.
new Foo.bar.baz<int>();
@ -44,8 +44,7 @@ main() {
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// [cfe] Method not found: 'Foo.bar.baz'.
const Foo();
@ -66,14 +65,14 @@ main() {
// [cfe] The method 'baz' isn't defined for the class 'Foo<int>'.
const Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
const Foo.bar<int>.baz();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// ^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^
// [cfe] Method not found: 'Foo.bar.baz'.
const Foo.bar.baz<int>();
@ -81,42 +80,41 @@ main() {
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// [cfe] Method not found: 'Foo.bar.baz'.
Foo();
Foo.bar();
Foo.bar.baz();
// ^^^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// ^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
Foo<int>();
Foo<int>.bar();
Foo<int>.bar.baz();
// ^^^^^
// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED
// [cfe] This requires the 'constructor-tearoffs' language feature to be enabled.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// ^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
Foo.bar<int>();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^^^^^
// [analyzer] COMPILE_TIME_ERROR.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR
Foo.bar<int>.baz();
// ^
// [cfe] A constructor invocation can't have type arguments on the constructor name.
//^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.CREATION_WITH_NON_TYPE
// ^
// [cfe] Method not found: 'Foo.bar.baz'.
// ^
// [cfe] A constructor invocation can't have type arguments after the constructor name.
// ^
// [cfe] Method not found: 'Foo.bar.baz'.
Foo.bar.baz<int>();
// ^^^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
// ^
// [cfe] Getter not found: 'bar'.
// ^^^
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_METHOD
}