[cfe] Allow instantiated type literals for constructor-tearoffs flag
Change-Id: I04de71bb4bcb4dc17dd28d5501b79d87a1bc5658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204200
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 953a360..fa29641 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -6304,12 +6304,20 @@
void handleTypeArgumentApplication(Token openAngleBracket) {
/// TODO(johnniwinther, paulberry): add support for this construct when the
/// "constructor-tearoffs" feature is enabled.
- pop(); // typeArguments
- addProblem(
- templateExperimentNotEnabled.withArguments('constructor-tearoffs',
- libraryBuilder.enableConstructorTearoffsVersionInLibrary.toText()),
- openAngleBracket.charOffset,
- noLength);
+ List<UnresolvedType> typeArguments = pop(); // typeArguments
+ if (libraryBuilder.enableConstructorTearOffsInLibrary) {
+ Generator generator = pop();
+ push(generator.applyTypeArguments(
+ openAngleBracket.charOffset, typeArguments));
+ } else {
+ addProblem(
+ templateExperimentNotEnabled.withArguments(
+ 'constructor-tearoffs',
+ libraryBuilder.enableConstructorTearOffsVersionInLibrary
+ .toText()),
+ openAngleBracket.charOffset,
+ noLength);
+ }
}
@override
@@ -6597,7 +6605,7 @@
// "constructor-tearoffs" feature is enabled.
addProblem(
templateExperimentNotEnabled.withArguments('constructor-tearoffs',
- libraryBuilder.enableConstructorTearoffsVersionInLibrary.toText()),
+ libraryBuilder.enableConstructorTearOffsVersionInLibrary.toText()),
token.charOffset,
token.length);
}
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 3069d7d..1efc687 100644
--- a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
@@ -253,6 +253,13 @@
offsetForToken(token), unaryName, buildSimpleRead());
}
+ /*Expression|Generator*/ applyTypeArguments(
+ int fileOffset, List<UnresolvedType> typeArguments) {
+ return new Instantiation(
+ buildSimpleRead(), _helper.buildDartTypeArguments(typeArguments))
+ ..fileOffset = fileOffset;
+ }
+
/// Returns a [TypeBuilder] for this subexpression instantiated with the
/// type [arguments]. If no type arguments are provided [arguments] is `null`.
///
@@ -2940,6 +2947,7 @@
///
class TypeUseGenerator extends ReadOnlyAccessGenerator {
final TypeDeclarationBuilder declaration;
+ List<UnresolvedType> typeArguments;
TypeUseGenerator(ExpressionGeneratorHelper helper, Token token,
this.declaration, String targetName)
@@ -3038,7 +3046,8 @@
_helper.buildDartType(
new UnresolvedType(
buildTypeWithResolvedArguments(
- _helper.libraryBuilder.nonNullableBuilder, null),
+ _helper.libraryBuilder.nonNullableBuilder,
+ typeArguments),
fileOffset,
_uri),
nonInstanceAccessIsError: true));
@@ -3160,6 +3169,12 @@
isTypeArgumentsInForest: isTypeArgumentsInForest);
}
}
+
+ @override
+ applyTypeArguments(int fileOffset, List<UnresolvedType> typeArguments) {
+ return new TypeUseGenerator(_helper, token, declaration, targetName)
+ ..typeArguments = typeArguments;
+ }
}
enum ReadOnlyAccessKind {
diff --git a/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart b/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart
index f9c2d18..ff56187 100644
--- a/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/implicit_field_type.dart
@@ -153,6 +153,9 @@
bodyBuilder.parseFieldInitializer(initializerToken);
initializerToken = null;
+ // The type is needed in the inference below, so the helper should be set.
+ typeInferrer.helper = bodyBuilder;
+
ExpressionInferenceResult result = typeInferrer.inferExpression(
initializer, const UnknownType(), true,
isVoidAllowed: true);
diff --git a/pkg/front_end/lib/src/fasta/source/outline_builder.dart b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
index f857afd..1b40d03 100644
--- a/pkg/front_end/lib/src/fasta/source/outline_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
@@ -2186,7 +2186,7 @@
// "constructor-tearoffs" feature is enabled.
addProblem(
templateExperimentNotEnabled.withArguments('constructor-tearoffs',
- libraryBuilder.enableConstructorTearoffsVersionInLibrary.toText()),
+ libraryBuilder.enableConstructorTearOffsVersionInLibrary.toText()),
token.charOffset,
token.length);
}
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index 5c72e58..317a63f 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -319,6 +319,7 @@
bool _enableExtensionMethodsInLibrary;
bool _enableGenericMetadataInLibrary;
bool _enableExtensionTypesInLibrary;
+ bool _enableConstructorTearOffsInLibrary;
bool get enableConstFunctionsInLibrary => _enableConstFunctionsInLibrary ??=
loader.target.isExperimentEnabledInLibraryByVersion(
@@ -352,7 +353,14 @@
.getExperimentEnabledVersionInLibrary(
ExperimentalFlag.nonNullable, _packageUri ?? importUri);
- Version get enableConstructorTearoffsVersionInLibrary =>
+ bool get enableConstructorTearOffsInLibrary =>
+ _enableConstructorTearOffsInLibrary ??= loader.target
+ .isExperimentEnabledInLibraryByVersion(
+ ExperimentalFlag.constructorTearoffs,
+ _packageUri ?? importUri,
+ languageVersion.version);
+
+ Version get enableConstructorTearOffsVersionInLibrary =>
_enableConstructorTearoffsVersionInLibrary ??= loader.target
.getExperimentEnabledVersionInLibrary(
ExperimentalFlag.constructorTearoffs, _packageUri ?? importUri);
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 31c797b..b9e60e0 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
@@ -14,56 +14,26 @@
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test4() => A<int>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:39: Error: Getter not found: 'new'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:47: Error: Getter not found: 'new'.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:39: Error: Getter not found: 'foo1'.
// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:47: Error: Getter not found: 'foo1'.
// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:39: Error: Getter not found: 'foo2'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:47: Error: Getter not found: 'foo2'.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^^^^
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 5b92215..216d862 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
@@ -14,56 +14,26 @@
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test4() => A<int>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:39: Error: Getter not found: 'new'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:47: Error: Getter not found: 'new'.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:39: Error: Getter not found: 'foo1'.
// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:47: Error: Getter not found: 'foo1'.
// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:39: Error: Getter not found: 'foo2'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:47: Error: Getter not found: 'foo2'.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^^^^
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 31c797b..b9e60e0 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
@@ -14,56 +14,26 @@
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test4() => A<int>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:39: Error: Getter not found: 'new'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:47: Error: Getter not found: 'new'.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:39: Error: Getter not found: 'foo1'.
// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:47: Error: Getter not found: 'foo1'.
// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:39: Error: Getter not found: 'foo2'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:47: Error: Getter not found: 'foo2'.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^^^^
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 5b92215..216d862 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
@@ -14,56 +14,26 @@
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test4() => A<int>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:39: Error: Getter not found: 'new'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:47: Error: Getter not found: 'new'.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:39: Error: Getter not found: 'foo1'.
// A<X> Function<X>(X) test6() => A<int>.foo1; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:17:47: Error: Getter not found: 'foo1'.
// A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:39: Error: Getter not found: 'foo2'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:33: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:47: Error: Getter not found: 'foo2'.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^^^^
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 264979c..bc6e6db 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
@@ -6,11 +6,6 @@
// testFoo() => A.foo; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:11:19: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooArgs() => A<int>.foo; // Ok.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:11:25: Error: Getter not found: 'foo'.
// testFooArgs() => A<int>.foo; // Ok.
// ^^^
@@ -19,29 +14,14 @@
// testNew() => A.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:13:19: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewArgs() => A<int>.new; // Ok.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:13:25: Error: Getter not found: 'new'.
// testNewArgs() => A<int>.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:15:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooExtraArgs() => A<int, String>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:15:38: Error: Getter not found: 'foo'.
// testFooExtraArgs() => A<int, String>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:16:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewExtraArgs() => A<int, String>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:16:38: Error: Getter not found: 'new'.
// testNewExtraArgs() => A<int, String>.new; // Error.
// ^^^
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 264979c..bc6e6db 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
@@ -6,11 +6,6 @@
// testFoo() => A.foo; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:11:19: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooArgs() => A<int>.foo; // Ok.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:11:25: Error: Getter not found: 'foo'.
// testFooArgs() => A<int>.foo; // Ok.
// ^^^
@@ -19,29 +14,14 @@
// testNew() => A.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:13:19: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewArgs() => A<int>.new; // Ok.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:13:25: Error: Getter not found: 'new'.
// testNewArgs() => A<int>.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:15:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooExtraArgs() => A<int, String>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:15:38: Error: Getter not found: 'foo'.
// testFooExtraArgs() => A<int, String>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:16:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewExtraArgs() => A<int, String>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:16:38: Error: Getter not found: 'new'.
// testNewExtraArgs() => A<int, String>.new; // Error.
// ^^^
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 264979c..bc6e6db 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
@@ -6,11 +6,6 @@
// testFoo() => A.foo; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:11:19: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooArgs() => A<int>.foo; // Ok.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:11:25: Error: Getter not found: 'foo'.
// testFooArgs() => A<int>.foo; // Ok.
// ^^^
@@ -19,29 +14,14 @@
// testNew() => A.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:13:19: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewArgs() => A<int>.new; // Ok.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:13:25: Error: Getter not found: 'new'.
// testNewArgs() => A<int>.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:15:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooExtraArgs() => A<int, String>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:15:38: Error: Getter not found: 'foo'.
// testFooExtraArgs() => A<int, String>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:16:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewExtraArgs() => A<int, String>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:16:38: Error: Getter not found: 'new'.
// testNewExtraArgs() => A<int, String>.new; // Error.
// ^^^
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 264979c..bc6e6db 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
@@ -6,11 +6,6 @@
// testFoo() => A.foo; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:11:19: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooArgs() => A<int>.foo; // Ok.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:11:25: Error: Getter not found: 'foo'.
// testFooArgs() => A<int>.foo; // Ok.
// ^^^
@@ -19,29 +14,14 @@
// testNew() => A.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:13:19: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewArgs() => A<int>.new; // Ok.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:13:25: Error: Getter not found: 'new'.
// testNewArgs() => A<int>.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:15:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooExtraArgs() => A<int, String>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:15:38: Error: Getter not found: 'foo'.
// testFooExtraArgs() => A<int, String>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:16:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewExtraArgs() => A<int, String>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart:16:38: Error: Getter not found: 'new'.
// testNewExtraArgs() => A<int, String>.new; // Error.
// ^^^
diff --git a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.expect b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.expect
index 7444b68..fac585b 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.expect
@@ -26,20 +26,10 @@
// A<dynamic> Function(String) test6() => A.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:38: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<dynamic> Function(num) test7() => A<num>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:44: Error: Getter not found: 'foo'.
// A<dynamic> Function(num) test7() => A<num>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:18:38: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<dynamic> Function(num) test8() => A<num>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:18:44: Error: Getter not found: 'new'.
// A<dynamic> Function(num) test8() => A<num>.new; // Error.
// ^^^
diff --git a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.transformed.expect
index 3a5a5ad..3bcaa2b 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.transformed.expect
@@ -26,20 +26,10 @@
// A<dynamic> Function(String) test6() => A.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:38: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<dynamic> Function(num) test7() => A<num>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:44: Error: Getter not found: 'foo'.
// A<dynamic> Function(num) test7() => A<num>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:18:38: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<dynamic> Function(num) test8() => A<num>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:18:44: Error: Getter not found: 'new'.
// A<dynamic> Function(num) test8() => A<num>.new; // Error.
// ^^^
diff --git a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.expect b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.expect
index 7444b68..fac585b 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.expect
@@ -26,20 +26,10 @@
// A<dynamic> Function(String) test6() => A.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:38: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<dynamic> Function(num) test7() => A<num>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:44: Error: Getter not found: 'foo'.
// A<dynamic> Function(num) test7() => A<num>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:18:38: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<dynamic> Function(num) test8() => A<num>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:18:44: Error: Getter not found: 'new'.
// A<dynamic> Function(num) test8() => A<num>.new; // Error.
// ^^^
diff --git a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.transformed.expect
index 3a5a5ad..3bcaa2b 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.transformed.expect
@@ -26,20 +26,10 @@
// A<dynamic> Function(String) test6() => A.new; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:38: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<dynamic> Function(num) test7() => A<num>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:44: Error: Getter not found: 'foo'.
// A<dynamic> Function(num) test7() => A<num>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:18:38: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// A<dynamic> Function(num) test8() => A<num>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:18:44: Error: Getter not found: 'new'.
// A<dynamic> Function(num) test8() => A<num>.new; // Error.
// ^^^
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 4374264..a888351 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
@@ -10,20 +10,10 @@
// testNew() => A.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:13:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooExtraArgs() => A<int>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:13:30: Error: Getter not found: 'foo'.
// testFooExtraArgs() => A<int>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:14:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewExtraArgs() => A<int>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:14:30: Error: Getter not found: 'new'.
// testNewExtraArgs() => A<int>.new; // Error.
// ^^^
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 4374264..a888351 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
@@ -10,20 +10,10 @@
// testNew() => A.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:13:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooExtraArgs() => A<int>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:13:30: Error: Getter not found: 'foo'.
// testFooExtraArgs() => A<int>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:14:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewExtraArgs() => A<int>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:14:30: Error: Getter not found: 'new'.
// testNewExtraArgs() => A<int>.new; // Error.
// ^^^
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 4374264..a888351 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
@@ -10,20 +10,10 @@
// testNew() => A.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:13:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooExtraArgs() => A<int>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:13:30: Error: Getter not found: 'foo'.
// testFooExtraArgs() => A<int>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:14:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewExtraArgs() => A<int>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:14:30: Error: Getter not found: 'new'.
// testNewExtraArgs() => A<int>.new; // Error.
// ^^^
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 4374264..a888351 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
@@ -10,20 +10,10 @@
// testNew() => A.new; // Ok.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:13:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testFooExtraArgs() => A<int>.foo; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:13:30: Error: Getter not found: 'foo'.
// testFooExtraArgs() => A<int>.foo; // Error.
// ^^^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:14:24: Error: This requires the 'constructor-tearoffs' language feature to be enabled.
-// Try updating your pubspec.yaml to set the minimum SDK constraint to 2.14 or higher, and running 'pub get'.
-// testNewExtraArgs() => A<int>.new; // Error.
-// ^
-//
// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart:14:30: Error: Getter not found: 'new'.
// testNewExtraArgs() => A<int>.new; // Error.
// ^^^
diff --git a/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart
new file mode 100644
index 0000000..74e7330
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart
@@ -0,0 +1,12 @@
+// 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.
+
+foo() => List<int>;
+
+bar() {
+ Type listString = List<String>;
+ return listString;
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.strong.expect b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.strong.expect
new file mode 100644
index 0000000..1b3499a
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.strong.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+static method foo() → dynamic
+ return #C1;
+static method bar() → dynamic {
+ core::Type listString = #C2;
+ return listString;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = TypeLiteralConstant(core::List<core::int>)
+ #C2 = TypeLiteralConstant(core::List<core::String>)
+}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.strong.transformed.expect
new file mode 100644
index 0000000..1b3499a
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.strong.transformed.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+static method foo() → dynamic
+ return #C1;
+static method bar() → dynamic {
+ core::Type listString = #C2;
+ return listString;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = TypeLiteralConstant(core::List<core::int>)
+ #C2 = TypeLiteralConstant(core::List<core::String>)
+}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.textual_outline.expect b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.textual_outline.expect
new file mode 100644
index 0000000..aef55ff
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.textual_outline.expect
@@ -0,0 +1,3 @@
+foo() => List<int>;
+bar() {}
+main() {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.weak.expect b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.weak.expect
new file mode 100644
index 0000000..1e0382a
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.weak.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+static method foo() → dynamic
+ return #C1;
+static method bar() → dynamic {
+ core::Type listString = #C2;
+ return listString;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = TypeLiteralConstant(core::List<core::int*>*)
+ #C2 = TypeLiteralConstant(core::List<core::String*>*)
+}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.weak.outline.expect b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.weak.outline.expect
new file mode 100644
index 0000000..0409188
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.weak.outline.expect
@@ -0,0 +1,9 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+
+static method foo() → dynamic
+ ;
+static method bar() → dynamic
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.weak.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.weak.transformed.expect
new file mode 100644
index 0000000..1e0382a
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/simple_instantiated_type_literals.dart.weak.transformed.expect
@@ -0,0 +1,16 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+static method foo() → dynamic
+ return #C1;
+static method bar() → dynamic {
+ core::Type listString = #C2;
+ return listString;
+}
+static method main() → dynamic {}
+
+constants {
+ #C1 = TypeLiteralConstant(core::List<core::int*>*)
+ #C2 = TypeLiteralConstant(core::List<core::String*>*)
+}
diff --git a/pkg/front_end/testcases/textual_outline.status b/pkg/front_end/testcases/textual_outline.status
index 5dd912a..7c64966 100644
--- a/pkg/front_end/testcases/textual_outline.status
+++ b/pkg/front_end/testcases/textual_outline.status
@@ -29,6 +29,7 @@
constructor_tearoffs/nongeneric_tearoff_with_context: FormatterCrash
constructor_tearoffs/nongeneric_tearoff_without_context: FormatterCrash
constructor_tearoffs/redirecting_constructors: FormatterCrash
+constructor_tearoffs/simple_instantiated_type_literals: FormatterCrash
constructor_tearoffs/unnamed_constructor: FormatterCrash
dart2js/late_fields: FormatterCrash
dart2js/late_statics: FormatterCrash