Version 2.14.0-298.0.dev
Merge commit '4b858b95f8834f2416119cb442a7fedf4c2e7a0b' into 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed952c4..ed07841 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -234,6 +234,63 @@
- Incremental compilation is now used for compilation of executables from
dependencies when using `dart run <package>:<command>`.
+#### Dart2JS
+
+* **Breaking Change** [#46545][]: Dart2JS emits ES6+ JavaScript by default,
+ thereby no longer supporting legacy browsers. Passing the
+ `--legacy-javascript` flag will let you opt out of this update, but this
+ flag will be removed in a future release. Modern browsers will not be
+ affected, as Dart2JS continues to support [last two major releases][1] of
+ Edge, Safari, Firefox, and Chrome.
+
+[#46545]: https://github.com/dart-lang/sdk/issues/46545
+[1]: https://dart.dev/faq#q-what-browsers-do-you-support-as-javascript-compilation-targets
+
+### Language
+
+* Add an unsigned shift right operator `>>>`. Pad with zeroes, ignoring the
+ sign bit. On the web platform `int.>>>` shifts the low 32 bits interpreted
+ as an unsigned integer, so `a >>> b` gives the same result as
+ `a.toUnsigned(32) >>> b` on the VM.
+
+* Prior to Dart 2.14, metadata (annotations) were not permitted to be
+ specified with generic type arguments. This restriction is lifted in Dart
+ Dart 2.14.
+
+ ```dart
+ class C<T> {
+ const C();
+ }
+ @C(); // Previously permitted.
+ @C<int>(); // Previously an error, now permitted.
+ ```
+
+* Prior to Dart 2.14, generic function types were not permitted as arguments
+ to generic classes or functions, nor to be used as generic bounds. This
+ restriction is lifted in Dart 2.14.
+
+ ```dart
+ T wrapWithLogging<T>(T f) {
+ if (f is void Function<T>(T x)) {
+ return <S>(S x) {
+ print("Call: f<$S>($x)");
+ var r = f<S>(x);
+ print("Return: $x");
+ return r;
+ } as T;
+ } // More cases here
+ return f;
+ }
+ void foo<T>(T x) {
+ print("Foo!");
+ }
+ void main() {
+ // Previously an error, now permitted.
+ var f = wrapWithLogging<void Function<T>(T)>(foo);
+ f<int>(3);
+ }
+ ```
+
## 2.13.4 - 2021-06-28
This is a patch release that fixes:
diff --git a/pkg/compiler/lib/src/options.dart b/pkg/compiler/lib/src/options.dart
index 91fad6a..c5288eb 100644
--- a/pkg/compiler/lib/src/options.dart
+++ b/pkg/compiler/lib/src/options.dart
@@ -81,8 +81,8 @@
// Initialize feature lists.
FeatureOptions() {
- shipping = [];
- canary = [legacyJavaScript, newHolders];
+ shipping = [legacyJavaScript];
+ canary = [newHolders];
}
void parse(List<String> options) {
diff --git a/pkg/compiler/test/codegen/class_order_test.dart b/pkg/compiler/test/codegen/class_order_test.dart
index b5f8b8d..efcd1f4 100644
--- a/pkg/compiler/test/codegen/class_order_test.dart
+++ b/pkg/compiler/test/codegen/class_order_test.dart
@@ -36,7 +36,7 @@
main() {
// Make sure that class A, B and C are emitted in that order. For simplicity
// we just verify that their members are in the correct order.
- RegExp regexp = new RegExp(r"foo\$0?:(.|\n)*bar\$0:(.|\n)*gee\$0:");
+ RegExp regexp = new RegExp(r"foo\$0?\((.|\n)*bar\$0\((.|\n)*gee\$0\(");
runTests() async {
String generated1 = await compileAll(TEST_ONE);
diff --git a/pkg/compiler/test/codegen/closure_codegen_test.dart b/pkg/compiler/test/codegen/closure_codegen_test.dart
index 516d526..90be45b 100644
--- a/pkg/compiler/test/codegen/closure_codegen_test.dart
+++ b/pkg/compiler/test/codegen/closure_codegen_test.dart
@@ -59,7 +59,7 @@
// the closure.
Future closureBailout({bool minify, String prefix}) async {
String generated = await compileAll(TEST_BAILOUT, minify: minify);
- RegExp regexp = new RegExp("$prefix\\\$0:${minify ? "" : " "}function");
+ RegExp regexp = new RegExp("$prefix\\\$0\\(\\)${minify ? "" : " "}{");
Iterator<Match> matches = regexp.allMatches(generated).iterator;
checkNumberOfMatches(matches, 1);
}
diff --git a/pkg/compiler/test/codegen/elide_callthrough_stub_test.dart b/pkg/compiler/test/codegen/elide_callthrough_stub_test.dart
index a7aaaa9..57852cc 100644
--- a/pkg/compiler/test/codegen/elide_callthrough_stub_test.dart
+++ b/pkg/compiler/test/codegen/elide_callthrough_stub_test.dart
@@ -45,7 +45,7 @@
// Direct call through field.
Expect.isTrue(generated1.contains(r'this._fun.call$1(zzz)'));
// No stub.
- Expect.isFalse(generated1.contains(r'_fun$1:'));
+ Expect.isFalse(generated1.contains(r'_fun$1(arg0) {'));
// No call to stub.
Expect.isFalse(generated1.contains(r'_fun$1('));
@@ -55,7 +55,8 @@
// Call through stub.
Expect.isTrue(generated2.contains(r'this._fun$1(zzz)'));
// Stub is generated.
- Expect.isTrue(generated2.contains(r'_fun$1:'));
+ print(generated2);
+ Expect.isTrue(generated2.contains(r'_fun$1(arg0) {'));
// Call through getter (inside stub).
Expect.isTrue(generated2.contains(r'get$_fun().call$1'));
}
diff --git a/pkg/compiler/test/codegen/no_duplicate_constructor_body2_test.dart b/pkg/compiler/test/codegen/no_duplicate_constructor_body2_test.dart
index b92f872..eadf758 100644
--- a/pkg/compiler/test/codegen/no_duplicate_constructor_body2_test.dart
+++ b/pkg/compiler/test/codegen/no_duplicate_constructor_body2_test.dart
@@ -26,7 +26,7 @@
main() {
runTest() async {
String generated = await compileAll(CODE);
- RegExp regexp = new RegExp(r'A\$0: function');
+ RegExp regexp = new RegExp(r'A\$0\(\) {');
Iterator<Match> matches = regexp.allMatches(generated).iterator;
checkNumberOfMatches(matches, 1);
}
diff --git a/pkg/compiler/test/codegen/no_duplicate_constructor_body_test.dart b/pkg/compiler/test/codegen/no_duplicate_constructor_body_test.dart
index a69550c..1a7ad71 100644
--- a/pkg/compiler/test/codegen/no_duplicate_constructor_body_test.dart
+++ b/pkg/compiler/test/codegen/no_duplicate_constructor_body_test.dart
@@ -25,7 +25,7 @@
Iterator<Match> matches = regexp.allMatches(generated).iterator;
checkNumberOfMatches(matches, 1);
- RegExp regexp2 = RegExp(r'A\$\w+: function');
+ RegExp regexp2 = RegExp(r'A\$\w+\(\w+\) {');
Iterator<Match> matches2 = regexp2.allMatches(generated).iterator;
checkNumberOfMatches(matches2, 1);
}
diff --git a/pkg/compiler/test/codegen/no_duplicate_stub_test.dart b/pkg/compiler/test/codegen/no_duplicate_stub_test.dart
index c414ad0..2a96106 100644
--- a/pkg/compiler/test/codegen/no_duplicate_stub_test.dart
+++ b/pkg/compiler/test/codegen/no_duplicate_stub_test.dart
@@ -33,7 +33,7 @@
main() {
runTest() async {
String generated = await compileAll(TEST);
- RegExp regexp = new RegExp('foo\\\$1\\\$a: function');
+ RegExp regexp = new RegExp(r'foo\$1\$a\(\w+\) {');
Iterator<Match> matches = regexp.allMatches(generated).iterator;
checkNumberOfMatches(matches, 1);
}
diff --git a/pkg/compiler/test/deferred/closures_test.dart b/pkg/compiler/test/deferred/closures_test.dart
index c672c81..a972d68 100644
--- a/pkg/compiler/test/deferred/closures_test.dart
+++ b/pkg/compiler/test/deferred/closures_test.dart
@@ -25,14 +25,14 @@
String mainOutput = collector.getOutput("", OutputType.js);
String deferredOutput = collector.getOutput("out_1", OutputType.jsPart);
- Expect.isTrue(mainOutput.contains("other_method_name:"));
- Expect.isFalse(mainOutput.contains("unique_method_name:"));
- Expect.isFalse(mainOutput.contains("unique_method_name_closure:"));
+ Expect.isTrue(mainOutput.contains("other_method_name() {"));
+ Expect.isFalse(mainOutput.contains("unique_method_name() {"));
+ Expect.isFalse(mainOutput.contains("unique_method_name_closure() {"));
Expect.isFalse(mainOutput.contains("unique-string"));
- Expect.isFalse(deferredOutput.contains("other_method_name:"));
- Expect.isTrue(deferredOutput.contains("unique_method_name:"));
- Expect.isTrue(deferredOutput.contains("unique_method_name_closure:"));
+ Expect.isFalse(deferredOutput.contains("other_method_name() {"));
+ Expect.isTrue(deferredOutput.contains("unique_method_name() {"));
+ Expect.isTrue(deferredOutput.contains("unique_method_name_closure() {"));
Expect.isTrue(deferredOutput.contains("unique-string"));
}
diff --git a/pkg/compiler/test/deferred_loading/data/lazy_types/main.dart b/pkg/compiler/test/deferred_loading/data/lazy_types/main.dart
index a5d40ab..0c00e5e 100644
--- a/pkg/compiler/test/deferred_loading/data/lazy_types/main.dart
+++ b/pkg/compiler/test/deferred_loading/data/lazy_types/main.dart
@@ -23,9 +23,9 @@
/*two-frag.library:
a_pre_fragments=[
- p1: {units: [1{libB}, 6{libA}], usedBy: [p2], needs: []},
- p2: {units: [5{libB, libC}, 4{libA, libC}, 2{libC}], usedBy: [p3], needs: [p1]},
- p3: {units: [3{libA, libB, libC}], usedBy: [], needs: [p2]}],
+ p1: {units: [1{libB}, 6{libA}], usedBy: [p2, p3], needs: []},
+ p2: {units: [4{libA, libC}, 2{libC}], usedBy: [p3], needs: [p1]},
+ p3: {units: [3{libA, libB, libC}, 5{libB, libC}], usedBy: [], needs: [p2, p1]}],
b_finalized_fragments=[
f1: [1{libB}, 6{libA}],
f2: [2{libC}],
diff --git a/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart b/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
index 526e78c..b012042 100644
--- a/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/type_alias_builder.dart
@@ -443,7 +443,8 @@
while (currentDeclarationBuilder is TypeAliasBuilder) {
TypeAliasBuilder currentAliasBuilder = currentDeclarationBuilder;
TypeBuilder? nextTypeBuilder = currentAliasBuilder.type;
- assert(nextTypeBuilder is NamedTypeBuilder);
+ assert(nextTypeBuilder is NamedTypeBuilder,
+ "Expected NamedTypeBuilder, got '${nextTypeBuilder.runtimeType}'.");
NamedTypeBuilder namedNextTypeBuilder =
nextTypeBuilder as NamedTypeBuilder;
Map<TypeVariableBuilder, TypeBuilder> substitution = {};
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 e9f71c5..5dc3f5b 100644
--- a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
@@ -54,6 +54,7 @@
import '../scope.dart';
+import '../source/source_library_builder.dart';
import '../source/stack_listener_impl.dart' show offsetForToken;
import 'body_builder.dart' show noLocation;
@@ -3097,12 +3098,39 @@
TypeDeclarationBuilder? declarationBuilder = declaration;
TypeAliasBuilder? aliasBuilder;
+ List<TypeBuilder>? unaliasedTypeArguments;
if (declarationBuilder is TypeAliasBuilder) {
aliasBuilder = declarationBuilder;
declarationBuilder = aliasBuilder.unaliasDeclaration(null,
isUsedAsClass: true,
usedAsClassCharOffset: this.fileOffset,
usedAsClassFileUri: _uri);
+ List<TypeBuilder>? aliasedTypeArguments =
+ typeArguments?.map((unknownType) => unknownType.builder).toList();
+ if (aliasedTypeArguments != null &&
+ aliasedTypeArguments.length != aliasBuilder.typeVariablesCount) {
+ _helper.libraryBuilder.addProblem(
+ templateTypeArgumentMismatch
+ .withArguments(aliasBuilder.typeVariablesCount),
+ fileOffset,
+ noLength,
+ _uri);
+ } else {
+ if (declarationBuilder is DeclarationBuilder) {
+ unaliasedTypeArguments =
+ aliasBuilder.unaliasTypeArguments(aliasedTypeArguments);
+ if (aliasedTypeArguments != null) {
+ _helper.libraryBuilder.uncheckedTypedefTypes.add(
+ new UncheckedTypedefType(new TypedefType(
+ aliasBuilder.typedef,
+ _helper.libraryBuilder.nonNullable,
+ aliasBuilder.buildTypeArguments(
+ _helper.libraryBuilder, aliasedTypeArguments)))
+ ..fileUri = _uri
+ ..offset = fileOffset);
+ }
+ }
+ }
}
if (declarationBuilder is DeclarationBuilder) {
DeclarationBuilder declaration = declarationBuilder;
@@ -3141,11 +3169,17 @@
operatorOffset, _helper.uri);
}
if (tearOffExpression != null) {
- return typeArguments != null
+ List<DartType>? builtTypeArguments;
+ if (unaliasedTypeArguments != null) {
+ builtTypeArguments = declarationBuilder.buildTypeArguments(
+ _helper.libraryBuilder, unaliasedTypeArguments);
+ } else if (typeArguments != null) {
+ builtTypeArguments =
+ _helper.buildDartTypeArguments(typeArguments);
+ }
+ return builtTypeArguments != null && builtTypeArguments.isNotEmpty
? _helper.forest.createInstantiation(
- token.charOffset,
- tearOffExpression,
- _helper.buildDartTypeArguments(typeArguments))
+ token.charOffset, tearOffExpression, builtTypeArguments)
: tearOffExpression;
}
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart b/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart
index 1ad1ecb..88a1430 100644
--- a/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart
@@ -8,7 +8,6 @@
import '../builder/builder.dart';
import '../builder/formal_parameter_builder.dart';
-import '../builder/library_builder.dart';
import '../builder/prefix_builder.dart';
import '../builder/type_declaration_builder.dart';
import '../builder/unresolved_type.dart';
@@ -17,6 +16,7 @@
import '../fasta_codes.dart' show LocatedMessage;
import '../messages.dart' show Message;
import '../scope.dart';
+import '../source/source_library_builder.dart' show SourceLibraryBuilder;
import '../type_inference/inference_helper.dart' show InferenceHelper;
import 'constness.dart' show Constness;
@@ -39,7 +39,7 @@
VariableDeclaration;
abstract class ExpressionGeneratorHelper implements InferenceHelper {
- LibraryBuilder get libraryBuilder;
+ SourceLibraryBuilder get libraryBuilder;
ConstantContext get constantContext;
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index d3835d4..c241a42 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -209,6 +209,7 @@
cx
d1a
d1b
+da
dacoharkes
dadd
daemon
diff --git a/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart
new file mode 100644
index 0000000..0abf8e6
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class A {}
+
+class B<X> {
+ B();
+ B.foo();
+ factory B.bar() => new B<X>();
+}
+
+typedef DA1 = A;
+
+typedef DA2<X extends num> = A;
+
+typedef DB1 = B<String>;
+
+typedef DB2<X extends num> = B<X>;
+
+typedef DB3<X extends num, Y extends String> = B<X>;
+
+DA1 Function() test1() => DA1.new; // Ok.
+A Function() test2() => DA1.new; // Ok.
+
+DA2<num> Function() test3() => DA2.new; // Ok.
+A Function() test4() => DA2.new; // Ok.
+A Function() test5() => DA2<String>.new; // Error.
+A Function() test6() => DA2<int>.new; // Ok.
+
+DB1 Function() test7() => DB1.new; // Ok.
+B<String> Function() test8() => DB1.new; // Ok.
+B<num> Function() test9() => DB1.new; // Error.
+B<String> Function() test10() => DB1.foo; // Ok.
+B<String> Function() test11() => DB1.bar; // Ok.
+
+B<num> Function() test12() => DB2<num>.new; // Ok.
+B<num> Function() test13() => DB2<num>.foo; // Ok.
+B<num> Function() test14() => DB2<num>.bar; // Ok.
+B<num> Function() test15() => DB2.new; // Ok.
+B<Y> Function<Y extends num>() test16() => DB2.new; // Ok.
+B<Y> Function<Y>() test17() => DB2.new; // Error.
+
+B<num> Function() test18() => DB3<num, String>.new; // Ok.
+B<num> Function() test19() => DB3<num, String>.foo; // Ok.
+B<num> Function() test20() => DB3<num, String>.bar; // Ok.
+B<num> Function() test21() => DB3.new; // Ok.
+B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new; // Ok.
+B<Y> Function<Y, Z>() test23() => DB2.new; // Error.
+
+main() {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.strong.expect b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.strong.expect
new file mode 100644
index 0000000..0a4373e
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.strong.expect
@@ -0,0 +1,122 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:28:25: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'DA2'.
+// Try changing type arguments so that they conform to the bounds.
+// A Function() test5() => DA2<String>.new; // Error.
+// ^
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:15:13: Context: This is the type variable whose bound isn't conformed to.
+// typedef DA2<X extends num> = A;
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<num> Function() test9() => DB1.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:41:44: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y extends num>() test16() => DB2.new; // Ok.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y>() test17() => DB2.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:48:62: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num, Z extends String>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new; // Ok.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y, Z>() test23() => DB2.new; // Error.
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef DA1 = self::A;
+typedef DA2<unrelated X extends core::num> = self::A;
+typedef DB1 = self::B<core::String>;
+typedef DB2<X extends core::num> = self::B<X>;
+typedef DB3<X extends core::num, unrelated Y extends core::String> = self::B<X>;
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+}
+class B<X extends core::Object? = dynamic> extends core::Object {
+ constructor •() → self::B<self::B::X%>
+ : super core::Object::•()
+ ;
+ constructor foo() → self::B<self::B::X%>
+ : super core::Object::•()
+ ;
+ static factory bar<X extends core::Object? = dynamic>() → self::B<self::B::bar::X%>
+ return new self::B::•<self::B::bar::X%>();
+}
+static method test1() → () → self::A
+ return self::A::•;
+static method test2() → () → self::A
+ return self::A::•;
+static method test3() → () → self::A
+ return self::A::•;
+static method test4() → () → self::A
+ return self::A::•;
+static method test5() → () → self::A
+ return self::A::•;
+static method test6() → () → self::A
+ return self::A::•;
+static method test7() → () → self::B<core::String>
+ return self::B::•<core::String>;
+static method test8() → () → self::B<core::String>
+ return self::B::•<core::String>;
+static method test9() → () → self::B<core::num>
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<num> Function() test9() => DB1.new; // Error.
+ ^" in (self::B::•<core::String>) as{TypeError,ForNonNullableByDefault} () → self::B<core::num>;
+static method test10() → () → self::B<core::String>
+ return self::B::foo<core::String>;
+static method test11() → () → self::B<core::String>
+ return self::B::bar<core::String>;
+static method test12() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test13() → () → self::B<core::num>
+ return self::B::foo<core::num>;
+static method test14() → () → self::B<core::num>
+ return self::B::bar<core::num>;
+static method test15() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test16() → <Y extends core::num = dynamic>() → self::B<Y>
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:41:44: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y extends num>() test16() => DB2.new; // Ok.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::num = dynamic>() → self::B<Y>;
+static method test17() → <Y extends core::Object? = dynamic>() → self::B<Y%>
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y>() test17() => DB2.new; // Error.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic>() → self::B<Y%>;
+static method test18() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test19() → () → self::B<core::num>
+ return self::B::foo<core::num>;
+static method test20() → () → self::B<core::num>
+ return self::B::bar<core::num>;
+static method test21() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test22() → <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y>
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:48:62: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num, Z extends String>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new; // Ok.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y>;
+static method test23() → <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y, Z>() test23() => DB2.new; // Error.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.strong.transformed.expect
new file mode 100644
index 0000000..0a4373e
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.strong.transformed.expect
@@ -0,0 +1,122 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:28:25: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'DA2'.
+// Try changing type arguments so that they conform to the bounds.
+// A Function() test5() => DA2<String>.new; // Error.
+// ^
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:15:13: Context: This is the type variable whose bound isn't conformed to.
+// typedef DA2<X extends num> = A;
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<num> Function() test9() => DB1.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:41:44: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y extends num>() test16() => DB2.new; // Ok.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y>() test17() => DB2.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:48:62: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num, Z extends String>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new; // Ok.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y, Z>() test23() => DB2.new; // Error.
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef DA1 = self::A;
+typedef DA2<unrelated X extends core::num> = self::A;
+typedef DB1 = self::B<core::String>;
+typedef DB2<X extends core::num> = self::B<X>;
+typedef DB3<X extends core::num, unrelated Y extends core::String> = self::B<X>;
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+}
+class B<X extends core::Object? = dynamic> extends core::Object {
+ constructor •() → self::B<self::B::X%>
+ : super core::Object::•()
+ ;
+ constructor foo() → self::B<self::B::X%>
+ : super core::Object::•()
+ ;
+ static factory bar<X extends core::Object? = dynamic>() → self::B<self::B::bar::X%>
+ return new self::B::•<self::B::bar::X%>();
+}
+static method test1() → () → self::A
+ return self::A::•;
+static method test2() → () → self::A
+ return self::A::•;
+static method test3() → () → self::A
+ return self::A::•;
+static method test4() → () → self::A
+ return self::A::•;
+static method test5() → () → self::A
+ return self::A::•;
+static method test6() → () → self::A
+ return self::A::•;
+static method test7() → () → self::B<core::String>
+ return self::B::•<core::String>;
+static method test8() → () → self::B<core::String>
+ return self::B::•<core::String>;
+static method test9() → () → self::B<core::num>
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<num> Function() test9() => DB1.new; // Error.
+ ^" in (self::B::•<core::String>) as{TypeError,ForNonNullableByDefault} () → self::B<core::num>;
+static method test10() → () → self::B<core::String>
+ return self::B::foo<core::String>;
+static method test11() → () → self::B<core::String>
+ return self::B::bar<core::String>;
+static method test12() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test13() → () → self::B<core::num>
+ return self::B::foo<core::num>;
+static method test14() → () → self::B<core::num>
+ return self::B::bar<core::num>;
+static method test15() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test16() → <Y extends core::num = dynamic>() → self::B<Y>
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:41:44: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y extends num>() test16() => DB2.new; // Ok.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::num = dynamic>() → self::B<Y>;
+static method test17() → <Y extends core::Object? = dynamic>() → self::B<Y%>
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y>() test17() => DB2.new; // Error.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic>() → self::B<Y%>;
+static method test18() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test19() → () → self::B<core::num>
+ return self::B::foo<core::num>;
+static method test20() → () → self::B<core::num>
+ return self::B::bar<core::num>;
+static method test21() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test22() → <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y>
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:48:62: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num, Z extends String>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new; // Ok.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y>;
+static method test23() → <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y, Z>() test23() => DB2.new; // Error.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.textual_outline.expect b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.textual_outline.expect
new file mode 100644
index 0000000..fe0d7be
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.textual_outline.expect
@@ -0,0 +1,35 @@
+class A {}
+class B<X> {
+ B();
+ B.foo();
+ factory B.bar() => new B<X>();
+}
+typedef DA1 = A;
+typedef DA2<X extends num> = A;
+typedef DB1 = B<String>;
+typedef DB2<X extends num> = B<X>;
+typedef DB3<X extends num, Y extends String> = B<X>;
+DA1 Function() test1() => DA1.new;
+A Function() test2() => DA1.new;
+DA2<num> Function() test3() => DA2.new;
+A Function() test4() => DA2.new;
+A Function() test5() => DA2<String>.new;
+A Function() test6() => DA2<int>.new;
+DB1 Function() test7() => DB1.new;
+B<String> Function() test8() => DB1.new;
+B<num> Function() test9() => DB1.new;
+B<String> Function() test10() => DB1.foo;
+B<String> Function() test11() => DB1.bar;
+B<num> Function() test12() => DB2<num>.new;
+B<num> Function() test13() => DB2<num>.foo;
+B<num> Function() test14() => DB2<num>.bar;
+B<num> Function() test15() => DB2.new;
+B<Y> Function<Y extends num>() test16() => DB2.new;
+B<Y> Function<Y>() test17() => DB2.new;
+B<num> Function() test18() => DB3<num, String>.new;
+B<num> Function() test19() => DB3<num, String>.foo;
+B<num> Function() test20() => DB3<num, String>.bar;
+B<num> Function() test21() => DB3.new;
+B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new;
+B<Y> Function<Y, Z>() test23() => DB2.new;
+main() {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.weak.expect b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.weak.expect
new file mode 100644
index 0000000..0a4373e
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.weak.expect
@@ -0,0 +1,122 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:28:25: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'DA2'.
+// Try changing type arguments so that they conform to the bounds.
+// A Function() test5() => DA2<String>.new; // Error.
+// ^
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:15:13: Context: This is the type variable whose bound isn't conformed to.
+// typedef DA2<X extends num> = A;
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<num> Function() test9() => DB1.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:41:44: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y extends num>() test16() => DB2.new; // Ok.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y>() test17() => DB2.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:48:62: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num, Z extends String>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new; // Ok.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y, Z>() test23() => DB2.new; // Error.
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef DA1 = self::A;
+typedef DA2<unrelated X extends core::num> = self::A;
+typedef DB1 = self::B<core::String>;
+typedef DB2<X extends core::num> = self::B<X>;
+typedef DB3<X extends core::num, unrelated Y extends core::String> = self::B<X>;
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+}
+class B<X extends core::Object? = dynamic> extends core::Object {
+ constructor •() → self::B<self::B::X%>
+ : super core::Object::•()
+ ;
+ constructor foo() → self::B<self::B::X%>
+ : super core::Object::•()
+ ;
+ static factory bar<X extends core::Object? = dynamic>() → self::B<self::B::bar::X%>
+ return new self::B::•<self::B::bar::X%>();
+}
+static method test1() → () → self::A
+ return self::A::•;
+static method test2() → () → self::A
+ return self::A::•;
+static method test3() → () → self::A
+ return self::A::•;
+static method test4() → () → self::A
+ return self::A::•;
+static method test5() → () → self::A
+ return self::A::•;
+static method test6() → () → self::A
+ return self::A::•;
+static method test7() → () → self::B<core::String>
+ return self::B::•<core::String>;
+static method test8() → () → self::B<core::String>
+ return self::B::•<core::String>;
+static method test9() → () → self::B<core::num>
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<num> Function() test9() => DB1.new; // Error.
+ ^" in (self::B::•<core::String>) as{TypeError,ForNonNullableByDefault} () → self::B<core::num>;
+static method test10() → () → self::B<core::String>
+ return self::B::foo<core::String>;
+static method test11() → () → self::B<core::String>
+ return self::B::bar<core::String>;
+static method test12() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test13() → () → self::B<core::num>
+ return self::B::foo<core::num>;
+static method test14() → () → self::B<core::num>
+ return self::B::bar<core::num>;
+static method test15() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test16() → <Y extends core::num = dynamic>() → self::B<Y>
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:41:44: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y extends num>() test16() => DB2.new; // Ok.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::num = dynamic>() → self::B<Y>;
+static method test17() → <Y extends core::Object? = dynamic>() → self::B<Y%>
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y>() test17() => DB2.new; // Error.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic>() → self::B<Y%>;
+static method test18() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test19() → () → self::B<core::num>
+ return self::B::foo<core::num>;
+static method test20() → () → self::B<core::num>
+ return self::B::bar<core::num>;
+static method test21() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test22() → <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y>
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:48:62: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num, Z extends String>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new; // Ok.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y>;
+static method test23() → <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y, Z>() test23() => DB2.new; // Error.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.weak.outline.expect b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.weak.outline.expect
new file mode 100644
index 0000000..7110e07
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.weak.outline.expect
@@ -0,0 +1,69 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+typedef DA1 = self::A;
+typedef DA2<unrelated X extends core::num> = self::A;
+typedef DB1 = self::B<core::String>;
+typedef DB2<X extends core::num> = self::B<X>;
+typedef DB3<X extends core::num, unrelated Y extends core::String> = self::B<X>;
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ ;
+}
+class B<X extends core::Object? = dynamic> extends core::Object {
+ constructor •() → self::B<self::B::X%>
+ ;
+ constructor foo() → self::B<self::B::X%>
+ ;
+ static factory bar<X extends core::Object? = dynamic>() → self::B<self::B::bar::X%>
+ ;
+}
+static method test1() → () → self::A
+ ;
+static method test2() → () → self::A
+ ;
+static method test3() → () → self::A
+ ;
+static method test4() → () → self::A
+ ;
+static method test5() → () → self::A
+ ;
+static method test6() → () → self::A
+ ;
+static method test7() → () → self::B<core::String>
+ ;
+static method test8() → () → self::B<core::String>
+ ;
+static method test9() → () → self::B<core::num>
+ ;
+static method test10() → () → self::B<core::String>
+ ;
+static method test11() → () → self::B<core::String>
+ ;
+static method test12() → () → self::B<core::num>
+ ;
+static method test13() → () → self::B<core::num>
+ ;
+static method test14() → () → self::B<core::num>
+ ;
+static method test15() → () → self::B<core::num>
+ ;
+static method test16() → <Y extends core::num = dynamic>() → self::B<Y>
+ ;
+static method test17() → <Y extends core::Object? = dynamic>() → self::B<Y%>
+ ;
+static method test18() → () → self::B<core::num>
+ ;
+static method test19() → () → self::B<core::num>
+ ;
+static method test20() → () → self::B<core::num>
+ ;
+static method test21() → () → self::B<core::num>
+ ;
+static method test22() → <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y>
+ ;
+static method test23() → <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.weak.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.weak.transformed.expect
new file mode 100644
index 0000000..0a4373e
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart.weak.transformed.expect
@@ -0,0 +1,122 @@
+library /*isNonNullableByDefault*/;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:28:25: Error: Type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'DA2'.
+// Try changing type arguments so that they conform to the bounds.
+// A Function() test5() => DA2<String>.new; // Error.
+// ^
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:15:13: Context: This is the type variable whose bound isn't conformed to.
+// typedef DA2<X extends num> = A;
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<num> Function() test9() => DB1.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:41:44: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y extends num>() test16() => DB2.new; // Ok.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y>() test17() => DB2.new; // Error.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:48:62: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num, Z extends String>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new; // Ok.
+// ^
+//
+// pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
+// - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+// B<Y> Function<Y, Z>() test23() => DB2.new; // Error.
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+typedef DA1 = self::A;
+typedef DA2<unrelated X extends core::num> = self::A;
+typedef DB1 = self::B<core::String>;
+typedef DB2<X extends core::num> = self::B<X>;
+typedef DB3<X extends core::num, unrelated Y extends core::String> = self::B<X>;
+class A extends core::Object {
+ synthetic constructor •() → self::A
+ : super core::Object::•()
+ ;
+}
+class B<X extends core::Object? = dynamic> extends core::Object {
+ constructor •() → self::B<self::B::X%>
+ : super core::Object::•()
+ ;
+ constructor foo() → self::B<self::B::X%>
+ : super core::Object::•()
+ ;
+ static factory bar<X extends core::Object? = dynamic>() → self::B<self::B::bar::X%>
+ return new self::B::•<self::B::bar::X%>();
+}
+static method test1() → () → self::A
+ return self::A::•;
+static method test2() → () → self::A
+ return self::A::•;
+static method test3() → () → self::A
+ return self::A::•;
+static method test4() → () → self::A
+ return self::A::•;
+static method test5() → () → self::A
+ return self::A::•;
+static method test6() → () → self::A
+ return self::A::•;
+static method test7() → () → self::B<core::String>
+ return self::B::•<core::String>;
+static method test8() → () → self::B<core::String>
+ return self::B::•<core::String>;
+static method test9() → () → self::B<core::num>
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:33:30: Error: A value of type 'B<String> Function()' can't be returned from a function with return type 'B<num> Function()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<num> Function() test9() => DB1.new; // Error.
+ ^" in (self::B::•<core::String>) as{TypeError,ForNonNullableByDefault} () → self::B<core::num>;
+static method test10() → () → self::B<core::String>
+ return self::B::foo<core::String>;
+static method test11() → () → self::B<core::String>
+ return self::B::bar<core::String>;
+static method test12() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test13() → () → self::B<core::num>
+ return self::B::foo<core::num>;
+static method test14() → () → self::B<core::num>
+ return self::B::bar<core::num>;
+static method test15() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test16() → <Y extends core::num = dynamic>() → self::B<Y>
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:41:44: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y extends num>() test16() => DB2.new; // Ok.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::num = dynamic>() → self::B<Y>;
+static method test17() → <Y extends core::Object? = dynamic>() → self::B<Y%>
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:42:32: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y>() test17() => DB2.new; // Error.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic>() → self::B<Y%>;
+static method test18() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test19() → () → self::B<core::num>
+ return self::B::foo<core::num>;
+static method test20() → () → self::B<core::num>
+ return self::B::bar<core::num>;
+static method test21() → () → self::B<core::num>
+ return self::B::•<core::num>;
+static method test22() → <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y>
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:48:62: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y extends num, Z extends String>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y extends num, Z extends String>() test22() => DB2.new; // Ok.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::num = dynamic, Z extends core::String = dynamic>() → self::B<Y>;
+static method test23() → <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart:49:35: Error: A value of type 'B<num> Function()' can't be returned from a function with return type 'B<Y> Function<Y, Z>()'.
+ - 'B' is from 'pkg/front_end/testcases/constructor_tearoffs/typedef_tearoffs.dart'.
+B<Y> Function<Y, Z>() test23() => DB2.new; // Error.
+ ^" in (self::B::•<core::num>) as{TypeError,ForNonNullableByDefault} <Y extends core::Object? = dynamic, Z extends core::Object? = dynamic>() → self::B<Y%>;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status
index a694e4f..b1e611f 100644
--- a/pkg/front_end/testcases/text_serialization.status
+++ b/pkg/front_end/testcases/text_serialization.status
@@ -13,6 +13,7 @@
constructor_tearoffs/nongeneric_tearoff_with_context: TextSerializationFailure
constructor_tearoffs/nongeneric_tearoff_without_context: TextSerializationFailure
constructor_tearoffs/redirecting_constructors: RuntimeError
+constructor_tearoffs/typedef_tearoffs: TextSerializationFailure
constructor_tearoffs/unnamed_constructor: TextSerializationFailure
extension_types/extension_on_nullable: ExpectationFileMismatchSerialized # Expected.
extension_types/issue45775: ExpectationFileMismatchSerialized # Expected.
diff --git a/pkg/front_end/testcases/textual_outline.status b/pkg/front_end/testcases/textual_outline.status
index e245752..a8a4fb3 100644
--- a/pkg/front_end/testcases/textual_outline.status
+++ b/pkg/front_end/testcases/textual_outline.status
@@ -32,6 +32,7 @@
constructor_tearoffs/nongeneric_tearoff_without_context: FormatterCrash
constructor_tearoffs/redirecting_constructors: FormatterCrash
constructor_tearoffs/simple_instantiated_type_literals: FormatterCrash
+constructor_tearoffs/typedef_tearoffs: FormatterCrash
constructor_tearoffs/unnamed_constructor: FormatterCrash
dart2js/late_fields: FormatterCrash
dart2js/late_statics: FormatterCrash
diff --git a/tools/VERSION b/tools/VERSION
index 70affaf..ca8974c 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 297
+PRERELEASE 298
PRERELEASE_PATCH 0
\ No newline at end of file