[cfe] Apply explicit type arguments in constructor tear-offs
Change-Id: I9a8e73d26e320d64f899c7799ad001369db918d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206242
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
index 9789db1..e9f71c5 100644
--- a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
@@ -3112,12 +3112,18 @@
if (member == null) {
// If we find a setter, [member] is an [AccessErrorBuilder], not null.
if (send is IncompletePropertyAccessGenerator) {
+ assert(
+ send.typeArguments == null,
+ "Unexpected non-null typeArguments of "
+ "an IncompletePropertyAccessGenerator object: "
+ "'${send.typeArguments.runtimeType}'.");
if (_helper.enableConstructorTearOffsInLibrary &&
declarationBuilder is ClassBuilder) {
MemberBuilder? constructor =
declarationBuilder.findConstructorOrFactory(
name.text, nameOffset, _uri, _helper.libraryBuilder);
Member? tearOff = constructor?.readTarget;
+ Expression? tearOffExpression;
if (tearOff is Constructor) {
if (declarationBuilder.isAbstract) {
return _helper.buildProblem(
@@ -3125,13 +3131,23 @@
nameOffset,
name.text.length);
}
- return _helper.forest
+ tearOffExpression = _helper.forest
.createConstructorTearOff(token.charOffset, tearOff);
} else if (tearOff is Procedure) {
- return _helper.forest
- .createStaticTearOff(token.charOffset, tearOff);
+ tearOffExpression =
+ _helper.forest.createStaticTearOff(token.charOffset, tearOff);
+ } else if (tearOff != null) {
+ unhandled("${tearOff.runtimeType}", "buildPropertyAccess",
+ operatorOffset, _helper.uri);
}
- // TODO(dmitryas): Add support for factories.
+ if (tearOffExpression != null) {
+ return typeArguments != null
+ ? _helper.forest.createInstantiation(
+ token.charOffset,
+ tearOffExpression,
+ _helper.buildDartTypeArguments(typeArguments))
+ : tearOffExpression;
+ }
}
generator = new UnresolvedNameGenerator(_helper, send.token, name);
} else {
diff --git a/pkg/front_end/lib/src/fasta/kernel/forest.dart b/pkg/front_end/lib/src/fasta/kernel/forest.dart
index 75d9371..0a6909a 100644
--- a/pkg/front_end/lib/src/fasta/kernel/forest.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/forest.dart
@@ -838,6 +838,14 @@
assert(fileOffset != null);
return new StaticTearOff(procedure)..fileOffset = fileOffset;
}
+
+ Instantiation createInstantiation(
+ int fileOffset, Expression expression, List<DartType> typeArguments) {
+ // ignore: unnecessary_null_comparison
+ assert(fileOffset != null);
+ return new Instantiation(expression, typeArguments)
+ ..fileOffset = fileOffset;
+ }
}
class _VariablesDeclaration extends Statement {
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.strong.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.strong.expect
index a63e674..3ac9d56 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.strong.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.strong.expect
@@ -16,31 +16,33 @@
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<int> Function()' can't be returned from a function with return type 'A<X> Function<X>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
-// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:32: Error: A value of type 'A<int> Function(int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<int> Function(int, int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
-// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^
//
@@ -82,41 +84,39 @@
A<X> Function<X>(X) test3() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test4() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<int> Function()' can't be returned from a function with return type 'A<X> Function<X>(X)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test4() => A<int>.new; // Error.
- ^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
+ ^" in (self::A::•<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test5() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
- ^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
+ ^";
static method test6() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return self::A::foo1;
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:32: Error: A value of type 'A<int> Function(int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
+ ^" in (self::A::foo1<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test7() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return self::A::foo1;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
+ ^";
static method test8() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<int> Function(int, int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
- ^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+ ^" in (self::A::foo2<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test9() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
- ^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+ ^";
static method test10() → <X extends core::Object? = dynamic>() → self::A<X%>
return self::A::bar1;
static method test11() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t7 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'unknown'.
- 'X/*2*/' is from 'unknown'.
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.strong.transformed.expect
index a63e674..3ac9d56 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.strong.transformed.expect
@@ -16,31 +16,33 @@
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<int> Function()' can't be returned from a function with return type 'A<X> Function<X>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
-// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:32: Error: A value of type 'A<int> Function(int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<int> Function(int, int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
-// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^
//
@@ -82,41 +84,39 @@
A<X> Function<X>(X) test3() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test4() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<int> Function()' can't be returned from a function with return type 'A<X> Function<X>(X)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test4() => A<int>.new; // Error.
- ^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
+ ^" in (self::A::•<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test5() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
- ^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
+ ^";
static method test6() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return self::A::foo1;
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:32: Error: A value of type 'A<int> Function(int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
+ ^" in (self::A::foo1<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test7() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return self::A::foo1;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
+ ^";
static method test8() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<int> Function(int, int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
- ^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+ ^" in (self::A::foo2<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test9() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
- ^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+ ^";
static method test10() → <X extends core::Object? = dynamic>() → self::A<X%>
return self::A::bar1;
static method test11() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t7 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'unknown'.
- 'X/*2*/' is from 'unknown'.
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.expect
index a63e674..3ac9d56 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.expect
@@ -16,31 +16,33 @@
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<int> Function()' can't be returned from a function with return type 'A<X> Function<X>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
-// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:32: Error: A value of type 'A<int> Function(int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<int> Function(int, int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
-// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^
//
@@ -82,41 +84,39 @@
A<X> Function<X>(X) test3() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test4() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<int> Function()' can't be returned from a function with return type 'A<X> Function<X>(X)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test4() => A<int>.new; // Error.
- ^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
+ ^" in (self::A::•<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test5() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
- ^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
+ ^";
static method test6() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return self::A::foo1;
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:32: Error: A value of type 'A<int> Function(int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
+ ^" in (self::A::foo1<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test7() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return self::A::foo1;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
+ ^";
static method test8() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<int> Function(int, int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
- ^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+ ^" in (self::A::foo2<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test9() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
- ^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+ ^";
static method test10() → <X extends core::Object? = dynamic>() → self::A<X%>
return self::A::bar1;
static method test11() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t7 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'unknown'.
- 'X/*2*/' is from 'unknown'.
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.transformed.expect
index a63e674..3ac9d56 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.transformed.expect
@@ -16,31 +16,33 @@
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<int> Function()' can't be returned from a function with return type 'A<X> Function<X>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
-// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:32: Error: A value of type 'A<int> Function(int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<int> Function(int, int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
-// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
-// - 'X/*2*/' is from 'unknown'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^
//
@@ -82,41 +84,39 @@
A<X> Function<X>(X) test3() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test4() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<int> Function()' can't be returned from a function with return type 'A<X> Function<X>(X)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test4() => A<int>.new; // Error.
- ^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
+ ^" in (self::A::•<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test5() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
- ^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
+ ^";
static method test6() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return self::A::foo1;
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:32: Error: A value of type 'A<int> Function(int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
+ ^" in (self::A::foo1<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test7() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return self::A::foo1;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
+ ^";
static method test8() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<int> Function(int, int)' can't be returned from a function with return type 'A<X> Function<X>(X)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
- ^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+ ^" in (self::A::foo2<core::int>) as{TypeError,ForNonNullableByDefault} Never;
static method test9() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- - 'X/*2*/' is from 'unknown'.
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
- ^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+ ^";
static method test10() → <X extends core::Object? = dynamic>() → self::A<X%>
return self::A::bar1;
static method test11() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t7 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'unknown'.
- 'X/*2*/' is from 'unknown'.
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.expect
index c6fd6e0..b9ace2c 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.expect
@@ -1,4 +1,22 @@
library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:18:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testFooExtraArgs() => A<int, String>.foo; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:19:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testNewExtraArgs() => A<int, String>.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:20:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testBarExtraArgs() => A<int, String>.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -13,19 +31,28 @@
static method testFoo() → dynamic
return self::A::foo;
static method testFooArgs() → dynamic
- return self::A::foo;
+ return self::A::foo<core::int>;
static method testNew() → dynamic
return self::A::•;
static method testNewArgs() → dynamic
- return self::A::•;
+ return self::A::•<core::int>;
static method testBar() → dynamic
return self::A::bar;
static method testBarArgs() → dynamic
- return self::A::bar;
+ return self::A::bar<core::int>;
static method testFooExtraArgs() → dynamic
- return self::A::foo;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:18:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testFooExtraArgs() => A<int, String>.foo; // Error.
+ ^";
static method testNewExtraArgs() → dynamic
- return self::A::•;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:19:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testNewExtraArgs() => A<int, String>.new; // Error.
+ ^";
static method testBarExtraArgs() → dynamic
- return self::A::bar;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:20:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testBarExtraArgs() => A<int, String>.bar; // Error.
+ ^";
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.transformed.expect
index c6fd6e0..b9ace2c 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.transformed.expect
@@ -1,4 +1,22 @@
library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:18:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testFooExtraArgs() => A<int, String>.foo; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:19:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testNewExtraArgs() => A<int, String>.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:20:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testBarExtraArgs() => A<int, String>.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -13,19 +31,28 @@
static method testFoo() → dynamic
return self::A::foo;
static method testFooArgs() → dynamic
- return self::A::foo;
+ return self::A::foo<core::int>;
static method testNew() → dynamic
return self::A::•;
static method testNewArgs() → dynamic
- return self::A::•;
+ return self::A::•<core::int>;
static method testBar() → dynamic
return self::A::bar;
static method testBarArgs() → dynamic
- return self::A::bar;
+ return self::A::bar<core::int>;
static method testFooExtraArgs() → dynamic
- return self::A::foo;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:18:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testFooExtraArgs() => A<int, String>.foo; // Error.
+ ^";
static method testNewExtraArgs() → dynamic
- return self::A::•;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:19:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testNewExtraArgs() => A<int, String>.new; // Error.
+ ^";
static method testBarExtraArgs() → dynamic
- return self::A::bar;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:20:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testBarExtraArgs() => A<int, String>.bar; // Error.
+ ^";
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.expect
index c6fd6e0..b9ace2c 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.expect
@@ -1,4 +1,22 @@
library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:18:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testFooExtraArgs() => A<int, String>.foo; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:19:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testNewExtraArgs() => A<int, String>.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:20:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testBarExtraArgs() => A<int, String>.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -13,19 +31,28 @@
static method testFoo() → dynamic
return self::A::foo;
static method testFooArgs() → dynamic
- return self::A::foo;
+ return self::A::foo<core::int>;
static method testNew() → dynamic
return self::A::•;
static method testNewArgs() → dynamic
- return self::A::•;
+ return self::A::•<core::int>;
static method testBar() → dynamic
return self::A::bar;
static method testBarArgs() → dynamic
- return self::A::bar;
+ return self::A::bar<core::int>;
static method testFooExtraArgs() → dynamic
- return self::A::foo;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:18:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testFooExtraArgs() => A<int, String>.foo; // Error.
+ ^";
static method testNewExtraArgs() → dynamic
- return self::A::•;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:19:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testNewExtraArgs() => A<int, String>.new; // Error.
+ ^";
static method testBarExtraArgs() → dynamic
- return self::A::bar;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:20:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testBarExtraArgs() => A<int, String>.bar; // Error.
+ ^";
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.transformed.expect
index c6fd6e0..b9ace2c 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.transformed.expect
@@ -1,4 +1,22 @@
library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:18:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testFooExtraArgs() => A<int, String>.foo; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:19:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testNewExtraArgs() => A<int, String>.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:20:23: Error: Too many type arguments: 1 allowed, but 2 found.
+// Try removing the extra type arguments.
+// testBarExtraArgs() => A<int, String>.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -13,19 +31,28 @@
static method testFoo() → dynamic
return self::A::foo;
static method testFooArgs() → dynamic
- return self::A::foo;
+ return self::A::foo<core::int>;
static method testNew() → dynamic
return self::A::•;
static method testNewArgs() → dynamic
- return self::A::•;
+ return self::A::•<core::int>;
static method testBar() → dynamic
return self::A::bar;
static method testBarArgs() → dynamic
- return self::A::bar;
+ return self::A::bar<core::int>;
static method testFooExtraArgs() → dynamic
- return self::A::foo;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:18:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testFooExtraArgs() => A<int, String>.foo; // Error.
+ ^";
static method testNewExtraArgs() → dynamic
- return self::A::•;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:19:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testNewExtraArgs() => A<int, String>.new; // Error.
+ ^";
static method testBarExtraArgs() → dynamic
- return self::A::bar;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:20:23: Error: Too many type arguments: 1 allowed, but 2 found.
+Try removing the extra type arguments.
+testBarExtraArgs() => A<int, String>.bar; // Error.
+ ^";
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.expect
index 96005b5..f6db3b2 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.expect
@@ -1,4 +1,25 @@
library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:15:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testFooExtraArgs() => A<int>.foo; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:16:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testNewExtraArgs() => A<int>.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:17:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testBarExtraArgs() => A<int>.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -17,9 +38,21 @@
static method testBar() → dynamic
return self::A::bar;
static method testFooExtraArgs() → dynamic
- return self::A::foo;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:15:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testFooExtraArgs() => A<int>.foo; // Error.
+ ^";
static method testNewExtraArgs() → dynamic
- return self::A::•;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:16:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testNewExtraArgs() => A<int>.new; // Error.
+ ^";
static method testBarExtraArgs() → dynamic
- return self::A::bar;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:17:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testBarExtraArgs() => A<int>.bar; // Error.
+ ^";
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.transformed.expect
index 96005b5..f6db3b2 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.transformed.expect
@@ -1,4 +1,25 @@
library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:15:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testFooExtraArgs() => A<int>.foo; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:16:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testNewExtraArgs() => A<int>.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:17:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testBarExtraArgs() => A<int>.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -17,9 +38,21 @@
static method testBar() → dynamic
return self::A::bar;
static method testFooExtraArgs() → dynamic
- return self::A::foo;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:15:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testFooExtraArgs() => A<int>.foo; // Error.
+ ^";
static method testNewExtraArgs() → dynamic
- return self::A::•;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:16:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testNewExtraArgs() => A<int>.new; // Error.
+ ^";
static method testBarExtraArgs() → dynamic
- return self::A::bar;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:17:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testBarExtraArgs() => A<int>.bar; // Error.
+ ^";
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.expect
index 96005b5..f6db3b2 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.expect
@@ -1,4 +1,25 @@
library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:15:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testFooExtraArgs() => A<int>.foo; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:16:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testNewExtraArgs() => A<int>.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:17:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testBarExtraArgs() => A<int>.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -17,9 +38,21 @@
static method testBar() → dynamic
return self::A::bar;
static method testFooExtraArgs() → dynamic
- return self::A::foo;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:15:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testFooExtraArgs() => A<int>.foo; // Error.
+ ^";
static method testNewExtraArgs() → dynamic
- return self::A::•;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:16:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testNewExtraArgs() => A<int>.new; // Error.
+ ^";
static method testBarExtraArgs() → dynamic
- return self::A::bar;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:17:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testBarExtraArgs() => A<int>.bar; // Error.
+ ^";
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.transformed.expect
index 96005b5..f6db3b2 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.transformed.expect
@@ -1,4 +1,25 @@
library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:15:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testFooExtraArgs() => A<int>.foo; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:16:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testNewExtraArgs() => A<int>.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:17:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+// Try changing the operand or remove the type arguments.
+// testBarExtraArgs() => A<int>.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -17,9 +38,21 @@
static method testBar() → dynamic
return self::A::bar;
static method testFooExtraArgs() → dynamic
- return self::A::foo;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:15:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testFooExtraArgs() => A<int>.foo; // Error.
+ ^";
static method testNewExtraArgs() → dynamic
- return self::A::•;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:16:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testNewExtraArgs() => A<int>.new; // Error.
+ ^";
static method testBarExtraArgs() → dynamic
- return self::A::bar;
+ return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:17:23: Error: The static type of the explicit instantiation operand must be a generic function type but is 'A Function()'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart'.
+Try changing the operand or remove the type arguments.
+testBarExtraArgs() => A<int>.bar; // Error.
+ ^";
static method main() → dynamic {}