Version 2.14.0-291.0.dev
Merge commit 'e6383f7562454cc43a40c10d122b20c9855b23aa' into 'dev'
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_final.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_final.dart
index 5d49d07..2a5b705 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/make_final.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/make_final.dart
@@ -43,6 +43,35 @@
return;
}
+ if (node is SimpleFormalParameter) {
+ await builder.addDartFileEdit(file, (builder) {
+ final keyword = node.keyword;
+ if (keyword != null && keyword.keyword == Keyword.VAR) {
+ builder.addSimpleReplacement(range.token(keyword), 'final');
+ } else {
+ final type = node.type;
+ if (type != null) {
+ builder.addSimpleInsertion(type.offset, 'final ');
+ return;
+ }
+ final identifier = node.identifier;
+ if (identifier != null) {
+ builder.addSimpleInsertion(identifier.offset, 'final ');
+ } else {
+ builder.addSimpleInsertion(node.offset, 'final ');
+ }
+ }
+ });
+ return;
+ }
+
+ if (node is SimpleIdentifier && parent is SimpleFormalParameter) {
+ await builder.addDartFileEdit(file, (builder) {
+ builder.addSimpleInsertion(node.offset, 'final ');
+ });
+ return;
+ }
+
VariableDeclarationList list;
if (node is SimpleIdentifier &&
parent is VariableDeclaration &&
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index c162055..50b36bd 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -96,6 +96,7 @@
errorCode.name == LintNames.prefer_equal_for_default_values ||
errorCode.name == LintNames.prefer_final_fields ||
errorCode.name == LintNames.prefer_final_locals ||
+ errorCode.name == LintNames.prefer_final_parameters ||
errorCode.name == LintNames.prefer_is_not_empty ||
errorCode.name == LintNames.type_init_formals ||
errorCode.name == LintNames.unawaited_futures ||
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 624d70a..ee44e16 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -456,6 +456,9 @@
LintNames.prefer_final_locals: [
MakeFinal.newInstance,
],
+ LintNames.prefer_final_parameters: [
+ MakeFinal.newInstance,
+ ],
LintNames.prefer_for_elements_to_map_fromIterable: [
ConvertMapFromIterableToForLiteral.newInstance,
],
diff --git a/pkg/analysis_server/lib/src/services/linter/lint_names.dart b/pkg/analysis_server/lib/src/services/linter/lint_names.dart
index 0bf6b44..4677b02 100644
--- a/pkg/analysis_server/lib/src/services/linter/lint_names.dart
+++ b/pkg/analysis_server/lib/src/services/linter/lint_names.dart
@@ -68,6 +68,7 @@
static const String prefer_final_fields = 'prefer_final_fields';
static const String prefer_final_in_for_each = 'prefer_final_in_for_each';
static const String prefer_final_locals = 'prefer_final_locals';
+ static const String prefer_final_parameters = 'prefer_final_parameters';
static const String prefer_for_elements_to_map_fromIterable =
'prefer_for_elements_to_map_fromIterable';
static const String prefer_generic_function_type_aliases =
diff --git a/pkg/analysis_server/test/src/services/correction/fix/make_final_test.dart b/pkg/analysis_server/test/src/services/correction/fix/make_final_test.dart
index d9e883f..d7771af 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/make_final_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/make_final_test.dart
@@ -16,6 +16,8 @@
defineReflectiveTests(PreferFinalFieldsWithNullSafetyTest);
defineReflectiveTests(PreferFinalInForEachTest);
defineReflectiveTests(PreferFinalLocalsBulkTest);
+ defineReflectiveTests(PreferFinalParametersTest);
+ defineReflectiveTests(PreferFinalParametersBulkTest);
});
}
@@ -186,3 +188,199 @@
''');
}
}
+
+@reflectiveTest
+class PreferFinalParametersBulkTest extends BulkFixProcessorTest {
+ @override
+ String get lintCode => LintNames.prefer_final_parameters;
+
+ Future<void> test_singleFile() async {
+ await resolveTestCode('''
+void fn(String test, int other) {
+ print(test);
+ print(other);
+}
+''');
+ await assertHasFix('''
+void fn(final String test, final int other) {
+ print(test);
+ print(other);
+}
+''');
+ }
+}
+
+@reflectiveTest
+class PreferFinalParametersTest extends FixProcessorLintTest {
+ @override
+ FixKind get kind => DartFixKind.MAKE_FINAL;
+
+ @override
+ String get lintCode => LintNames.prefer_final_parameters;
+
+ Future<void> test_class_constructor() async {
+ await resolveTestCode('''
+class C {
+ C(String content) {
+ print(content);
+ }
+}
+''');
+ await assertHasFix('''
+class C {
+ C(final String content) {
+ print(content);
+ }
+}
+''');
+ }
+
+ Future<void> test_class_requiredCovariant() async {
+ await resolveTestCode('''
+class C {
+ void fn({required covariant String test}) {
+ print(test);
+ }
+}
+''');
+ await assertHasFix('''
+class C {
+ void fn({required covariant final String test}) {
+ print(test);
+ }
+}
+''');
+ }
+
+ Future<void> test_closure_hasType() async {
+ await resolveTestCode('''
+void fn() {
+ ['1', '2', '3'].forEach((String string) => print(string));
+}
+''');
+ await assertHasFix('''
+void fn() {
+ ['1', '2', '3'].forEach((final String string) => print(string));
+}
+''');
+ }
+
+ Future<void> test_closure_noType() async {
+ await resolveTestCode('''
+void fn() {
+ ['1', '2', '3'].forEach((string) => print(string));
+}
+''');
+ await assertHasFix('''
+void fn() {
+ ['1', '2', '3'].forEach((final string) => print(string));
+}
+''');
+ }
+
+ Future<void> test_functionLiteral() async {
+ await resolveTestCode('''
+var fn = (String test) {
+ print(test);
+};
+''');
+ await assertHasFix('''
+var fn = (final String test) {
+ print(test);
+};
+''');
+ }
+
+ Future<void> test_named_optional() async {
+ await resolveTestCode('''
+void fn({String? test}) {
+ print(test);
+}
+''');
+ await assertHasFix('''
+void fn({final String? test}) {
+ print(test);
+}
+''');
+ }
+
+ Future<void> test_named_required() async {
+ await resolveTestCode('''
+void fn({required String test}) {
+ print(test);
+}
+''');
+ await assertHasFix('''
+void fn({required final String test}) {
+ print(test);
+}
+''');
+ }
+
+ Future<void> test_positional_optional() async {
+ await resolveTestCode('''
+void fn([String? test]) {
+ print(test);
+}
+''');
+ await assertHasFix('''
+void fn([final String? test]) {
+ print(test);
+}
+''');
+ }
+
+ Future<void> test_simple_hasType() async {
+ await resolveTestCode('''
+void fn(String test) {
+ print(test);
+}
+''');
+ await assertHasFix('''
+void fn(final String test) {
+ print(test);
+}
+''');
+ }
+
+ Future<void> test_simple_noType() async {
+ await resolveTestCode('''
+void fn(test) {
+ print(test);
+}
+''');
+ await assertHasFix('''
+void fn(final test) {
+ print(test);
+}
+''');
+ }
+
+ Future<void> test_simple_second() async {
+ await resolveTestCode('''
+void fn(final String test, String other) {
+ print(test);
+ print(other);
+}
+''');
+ await assertHasFix('''
+void fn(final String test, final String other) {
+ print(test);
+ print(other);
+}
+''');
+ }
+
+ Future<void> test_simple_var() async {
+ await resolveTestCode('''
+void fn(var test) {
+ print(test);
+}
+''');
+ await assertHasFix('''
+void fn(final test) {
+ print(test);
+}
+''');
+ }
+}
diff --git a/pkg/front_end/lib/src/fasta/builder/class_builder.dart b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
index 09a4810..7701321 100644
--- a/pkg/front_end/lib/src/fasta/builder/class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
@@ -1135,7 +1135,9 @@
}
if (instanceClass != null) {
for (Constructor constructor in instanceClass.constructors) {
- if (constructor.name == name) return constructor;
+ if (constructor.name == name) {
+ return constructor;
+ }
}
}
diff --git a/pkg/front_end/lib/src/fasta/builder/constructor_builder.dart b/pkg/front_end/lib/src/fasta/builder/constructor_builder.dart
index d659697..f2810a8 100644
--- a/pkg/front_end/lib/src/fasta/builder/constructor_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/constructor_builder.dart
@@ -7,6 +7,8 @@
import 'package:kernel/ast.dart';
import 'package:kernel/core_types.dart';
+import '../builder/library_builder.dart';
+
import '../constant_context.dart' show ConstantContext;
import '../dill/dill_member_builder.dart';
@@ -484,8 +486,13 @@
List<DelayedActionPerformer> delayedActionPerformers) {
if (_origin != null) {
// Ensure that default value expressions have been created for [_origin].
- _origin!.buildOutlineExpressions(
- libraryBuilder, coreTypes, delayedActionPerformers);
+ LibraryBuilder originLibraryBuilder = _origin!.library;
+ if (originLibraryBuilder is SourceLibraryBuilder) {
+ // If [_origin] is from a source library, we need to build the default
+ // values and initializers first.
+ _origin!.buildOutlineExpressions(
+ originLibraryBuilder, coreTypes, delayedActionPerformers);
+ }
_clonedFunctionNode!.cloneDefaultValues();
_clonedFunctionNode = null;
_origin = null;
diff --git a/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart b/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart
index e47840f..368e69c 100644
--- a/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/procedure_builder.dart
@@ -313,10 +313,10 @@
return extensionTearOff ?? procedure;
case ProcedureKind.Getter:
return procedure;
+ case ProcedureKind.Factory:
+ return procedure;
case ProcedureKind.Operator:
case ProcedureKind.Setter:
- case ProcedureKind.Factory:
- return null;
}
}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart
index ff2f3fe4..0cf0e78 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart
@@ -6,6 +6,7 @@
A.foo1(X x) {}
A.foo2(X x, int y) {}
A();
+ factory A.bar1() => new A();
}
A<X> Function<X>(X) test1() => A.foo1; // Ok.
@@ -17,5 +18,9 @@
A<X> Function<X>(X) test7() => A<int, String>.foo1; // Error.
A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
+A<X> Function<X>() test10() => A.bar1; // Ok.
+A<X> Function<X>(X) test11() => A.bar1; // Error.
+A<int> Function() test12() => A<int>.bar1; // Ok.
+A<int> Function() test13() => A.bar1; // Ok.
main() {}
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 f3930d4..a63e674 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
@@ -2,48 +2,55 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:12:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test2() => A.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+// - 'X/*1*/' is from 'unknown'.
+// - 'X/*2*/' is from 'unknown'.
+// A<X> Function<X>(X) test11() => A.bar1; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -55,32 +62,34 @@
constructor •() → self::A<self::A::X%>
: super core::Object::•()
;
+ static factory bar1<X extends core::Object? = dynamic>() → self::A<self::A::bar1::X%>
+ return new self::A::•<self::A::bar1::X%>();
}
static method test1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
return self::A::foo1;
static method test2() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:12:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test2() => A.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
static method test3() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test3() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test4() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test4() => A<int>.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test5() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
@@ -91,17 +100,30 @@
static method test7() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
return self::A::foo1;
static method test8() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
static method test9() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+static method test10() → <X extends core::Object? = dynamic>() → self::A<X%>
+ return self::A::bar1;
+static method test11() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
+ return let final Never #t7 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+ - 'X/*1*/' is from 'unknown'.
+ - 'X/*2*/' is from 'unknown'.
+A<X> Function<X>(X) test11() => A.bar1; // Error.
+ ^" in self::A::bar1 as{TypeError,ForNonNullableByDefault} Never;
+static method test12() → () → self::A<core::int>
+ return self::A::bar1<core::int>;
+static method test13() → () → self::A<core::int>
+ return self::A::bar1<core::int>;
static method main() → dynamic {}
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 f3930d4..a63e674 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
@@ -2,48 +2,55 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:12:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test2() => A.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+// - 'X/*1*/' is from 'unknown'.
+// - 'X/*2*/' is from 'unknown'.
+// A<X> Function<X>(X) test11() => A.bar1; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -55,32 +62,34 @@
constructor •() → self::A<self::A::X%>
: super core::Object::•()
;
+ static factory bar1<X extends core::Object? = dynamic>() → self::A<self::A::bar1::X%>
+ return new self::A::•<self::A::bar1::X%>();
}
static method test1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
return self::A::foo1;
static method test2() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:12:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test2() => A.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
static method test3() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test3() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test4() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test4() => A<int>.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test5() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
@@ -91,17 +100,30 @@
static method test7() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
return self::A::foo1;
static method test8() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
static method test9() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+static method test10() → <X extends core::Object? = dynamic>() → self::A<X%>
+ return self::A::bar1;
+static method test11() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
+ return let final Never #t7 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+ - 'X/*1*/' is from 'unknown'.
+ - 'X/*2*/' is from 'unknown'.
+A<X> Function<X>(X) test11() => A.bar1; // Error.
+ ^" in self::A::bar1 as{TypeError,ForNonNullableByDefault} Never;
+static method test12() → () → self::A<core::int>
+ return self::A::bar1<core::int>;
+static method test13() → () → self::A<core::int>
+ return self::A::bar1<core::int>;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.textual_outline.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.textual_outline.expect
index 6aba9ce..89a5de5 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.textual_outline.expect
@@ -2,6 +2,7 @@
A.foo1(X x) {}
A.foo2(X x, int y) {}
A();
+ factory A.bar1() => new A();
}
A<X> Function<X>(X) test1() => A.foo1;
A<X> Function<X>(X) test2() => A.foo2;
@@ -12,4 +13,8 @@
A<X> Function<X>(X) test7() => A<int, String>.foo1;
A<X> Function<X>(X) test8() => A<int>.foo2;
A<X> Function<X>(X) test9() => A<int, String>.foo2;
+A<X> Function<X>() test10() => A.bar1;
+A<X> Function<X>(X) test11() => A.bar1;
+A<int> Function() test12() => A<int>.bar1;
+A<int> Function() test13() => A.bar1;
main() {}
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 f3930d4..a63e674 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
@@ -2,48 +2,55 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:12:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test2() => A.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+// - 'X/*1*/' is from 'unknown'.
+// - 'X/*2*/' is from 'unknown'.
+// A<X> Function<X>(X) test11() => A.bar1; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -55,32 +62,34 @@
constructor •() → self::A<self::A::X%>
: super core::Object::•()
;
+ static factory bar1<X extends core::Object? = dynamic>() → self::A<self::A::bar1::X%>
+ return new self::A::•<self::A::bar1::X%>();
}
static method test1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
return self::A::foo1;
static method test2() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:12:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test2() => A.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
static method test3() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test3() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test4() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test4() => A<int>.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test5() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
@@ -91,17 +100,30 @@
static method test7() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
return self::A::foo1;
static method test8() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
static method test9() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+static method test10() → <X extends core::Object? = dynamic>() → self::A<X%>
+ return self::A::bar1;
+static method test11() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
+ return let final Never #t7 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+ - 'X/*1*/' is from 'unknown'.
+ - 'X/*2*/' is from 'unknown'.
+A<X> Function<X>(X) test11() => A.bar1; // Error.
+ ^" in self::A::bar1 as{TypeError,ForNonNullableByDefault} Never;
+static method test12() → () → self::A<core::int>
+ return self::A::bar1<core::int>;
+static method test13() → () → self::A<core::int>
+ return self::A::bar1<core::int>;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.outline.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.outline.expect
index 4e4b8c9..bbcc8a8 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart.weak.outline.expect
@@ -9,6 +9,8 @@
;
constructor •() → self::A<self::A::X%>
;
+ static factory bar1<X extends core::Object? = dynamic>() → self::A<self::A::bar1::X%>
+ ;
}
static method test1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
;
@@ -28,5 +30,13 @@
;
static method test9() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
;
+static method test10() → <X extends core::Object? = dynamic>() → self::A<X%>
+ ;
+static method test11() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
+ ;
+static method test12() → () → self::A<core::int>
+ ;
+static method test13() → () → self::A<core::int>
+ ;
static method main() → dynamic
;
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 f3930d4..a63e674 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
@@ -2,48 +2,55 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:12:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test2() => A.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test3() => A.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test4() => A<int>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test5() => A<int, String>.new; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
// - 'X/*2*/' is from 'unknown'.
// A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+// - 'X/*1*/' is from 'unknown'.
+// - 'X/*2*/' is from 'unknown'.
+// A<X> Function<X>(X) test11() => A.bar1; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -55,32 +62,34 @@
constructor •() → self::A<self::A::X%>
: super core::Object::•()
;
+ static factory bar1<X extends core::Object? = dynamic>() → self::A<self::A::bar1::X%>
+ return new self::A::•<self::A::bar1::X%>();
}
static method test1() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
return self::A::foo1;
static method test2() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:12:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test2() => A.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
static method test3() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:13:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test3() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test4() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:14:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test4() => A<int>.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} Never;
static method test5() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:15:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t4 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:16:32: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
@@ -91,17 +100,30 @@
static method test7() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
return self::A::foo1;
static method test8() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:18:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t5 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test8() => A<int>.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
static method test9() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
- return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:19:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ return let final Never #t6 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:20:32: Error: A value of type 'A<X/*1*/> Function<X>(X/*1*/, int)' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*1*/' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
- 'X/*2*/' is from 'unknown'.
A<X> Function<X>(X) test9() => A<int, String>.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} Never;
+static method test10() → <X extends core::Object? = dynamic>() → self::A<X%>
+ return self::A::bar1;
+static method test11() → <X extends core::Object? = dynamic>(X%) → self::A<X%>
+ return let final Never #t7 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart:22:33: Error: A value of type 'A<X/*1*/> Function<X>()' can't be returned from a function with return type 'A<X/*2*/> Function<X>(X/*2*/)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_with_context.dart'.
+ - 'X/*1*/' is from 'unknown'.
+ - 'X/*2*/' is from 'unknown'.
+A<X> Function<X>(X) test11() => A.bar1; // Error.
+ ^" in self::A::bar1 as{TypeError,ForNonNullableByDefault} Never;
+static method test12() → () → self::A<core::int>
+ return self::A::bar1<core::int>;
+static method test13() → () → self::A<core::int>
+ return self::A::bar1<core::int>;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart
index 8536334..b668e20 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart
@@ -5,14 +5,18 @@
class A<X> {
A.foo() {}
A() {}
+ factory A.bar() => new A<X>();
}
testFoo() => A.foo; // Ok.
testFooArgs() => A<int>.foo; // Ok.
testNew() => A.new; // Ok.
testNewArgs() => A<int>.new; // Ok.
+testBar() => A.bar; // Ok.
+testBarArgs() => A<int>.bar; // Ok.
testFooExtraArgs() => A<int, String>.foo; // Error.
testNewExtraArgs() => A<int, String>.new; // Error.
+testBarExtraArgs() => A<int, String>.bar; // Error.
main() {}
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 fdf0c65..c6fd6e0 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
@@ -7,6 +7,8 @@
: super core::Object::•() {}
constructor •() → self::A<self::A::X%>
: super core::Object::•() {}
+ static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
+ return new self::A::•<self::A::bar::X%>();
}
static method testFoo() → dynamic
return self::A::foo;
@@ -16,8 +18,14 @@
return self::A::•;
static method testNewArgs() → dynamic
return self::A::•;
+static method testBar() → dynamic
+ return self::A::bar;
+static method testBarArgs() → dynamic
+ return self::A::bar;
static method testFooExtraArgs() → dynamic
return self::A::foo;
static method testNewExtraArgs() → dynamic
return self::A::•;
+static method testBarExtraArgs() → dynamic
+ return self::A::bar;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.strong.transformed.expect
index fdf0c65..c6fd6e0 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
@@ -7,6 +7,8 @@
: super core::Object::•() {}
constructor •() → self::A<self::A::X%>
: super core::Object::•() {}
+ static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
+ return new self::A::•<self::A::bar::X%>();
}
static method testFoo() → dynamic
return self::A::foo;
@@ -16,8 +18,14 @@
return self::A::•;
static method testNewArgs() → dynamic
return self::A::•;
+static method testBar() → dynamic
+ return self::A::bar;
+static method testBarArgs() → dynamic
+ return self::A::bar;
static method testFooExtraArgs() → dynamic
return self::A::foo;
static method testNewExtraArgs() → dynamic
return self::A::•;
+static method testBarExtraArgs() → dynamic
+ return self::A::bar;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.textual_outline.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.textual_outline.expect
index 79f321c..4b026de 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.textual_outline.expect
@@ -1,11 +1,15 @@
class A<X> {
A.foo() {}
A() {}
+ factory A.bar() => new A<X>();
}
testFoo() => A.foo;
testFooArgs() => A<int>.foo;
testNew() => A.new;
testNewArgs() => A<int>.new;
+testBar() => A.bar;
+testBarArgs() => A<int>.bar;
testFooExtraArgs() => A<int, String>.foo;
testNewExtraArgs() => A<int, String>.new;
+testBarExtraArgs() => A<int, String>.bar;
main() {}
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 fdf0c65..c6fd6e0 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
@@ -7,6 +7,8 @@
: super core::Object::•() {}
constructor •() → self::A<self::A::X%>
: super core::Object::•() {}
+ static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
+ return new self::A::•<self::A::bar::X%>();
}
static method testFoo() → dynamic
return self::A::foo;
@@ -16,8 +18,14 @@
return self::A::•;
static method testNewArgs() → dynamic
return self::A::•;
+static method testBar() → dynamic
+ return self::A::bar;
+static method testBarArgs() → dynamic
+ return self::A::bar;
static method testFooExtraArgs() → dynamic
return self::A::foo;
static method testNewExtraArgs() → dynamic
return self::A::•;
+static method testBarExtraArgs() → dynamic
+ return self::A::bar;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.outline.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.outline.expect
index b51752b..e5848bc 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.outline.expect
@@ -7,6 +7,8 @@
;
constructor •() → self::A<self::A::X%>
;
+ static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
+ ;
}
static method testFoo() → dynamic
;
@@ -16,9 +18,15 @@
;
static method testNewArgs() → dynamic
;
+static method testBar() → dynamic
+ ;
+static method testBarArgs() → dynamic
+ ;
static method testFooExtraArgs() → dynamic
;
static method testNewExtraArgs() → dynamic
;
+static method testBarExtraArgs() → dynamic
+ ;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/generic_tearoff_without_context.dart.weak.transformed.expect
index fdf0c65..c6fd6e0 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
@@ -7,6 +7,8 @@
: super core::Object::•() {}
constructor •() → self::A<self::A::X%>
: super core::Object::•() {}
+ static factory bar<X extends core::Object? = dynamic>() → self::A<self::A::bar::X%>
+ return new self::A::•<self::A::bar::X%>();
}
static method testFoo() → dynamic
return self::A::foo;
@@ -16,8 +18,14 @@
return self::A::•;
static method testNewArgs() → dynamic
return self::A::•;
+static method testBar() → dynamic
+ return self::A::bar;
+static method testBarArgs() → dynamic
+ return self::A::bar;
static method testFooExtraArgs() → dynamic
return self::A::foo;
static method testNewExtraArgs() → dynamic
return self::A::•;
+static method testBarExtraArgs() → dynamic
+ return self::A::bar;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart
index 5128252..129870f 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart
+++ b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart
@@ -5,6 +5,7 @@
class A<X extends num> {
A.foo(X x) {}
A(X x) {}
+ factory A.bar(X x) => new A<X>(x);
}
A<num> Function(num) test1() => A.foo; // Ok.
@@ -14,7 +15,12 @@
A<dynamic> Function(String) test5() => A.foo; // Error.
A<dynamic> Function(String) test6() => A.new; // Error.
-A<dynamic> Function(num) test7() => A<num>.foo; // Error.
-A<dynamic> Function(num) test8() => A<num>.new; // Error.
+A<dynamic> Function(num) test7() => A<num>.foo; // Ok.
+A<dynamic> Function(num) test8() => A<num>.new; // Ok.
+
+A<num> Function(num) test9() => A.bar; // Ok.
+A<int> Function(int) test10() => A.bar; // Ok.
+A<dynamic> Function(String) test11() => A.bar; // Error.
+A<dynamic> Function(num) test12() => A.bar; // Ok.
main() {}
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 86f5a15..33ffc2b 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.strong.expect
@@ -2,7 +2,7 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:15:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
+// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:16:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/instantiation.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// A<dynamic> Function(String) test5() => A.foo; // Error.
@@ -11,7 +11,7 @@
// class A<X extends num> {
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:16:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
+// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/instantiation.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// A<dynamic> Function(String) test6() => A.new; // Error.
@@ -20,6 +20,12 @@
// class A<X extends num> {
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:23:41: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/instantiation.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// A<dynamic> Function(String) test11() => A.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -28,6 +34,8 @@
: super core::Object::•() {}
constructor •(self::A::X x) → self::A<self::A::X>
: super core::Object::•() {}
+ static factory bar<X extends core::num>(self::A::bar::X x) → self::A<self::A::bar::X>
+ return new self::A::•<self::A::bar::X>(x);
}
static method test1() → (core::num) → self::A<core::num>
return self::A::foo<core::num>;
@@ -45,4 +53,12 @@
return self::A::foo<core::num>;
static method test8() → (core::num) → self::A<dynamic>
return self::A::•<core::num>;
+static method test9() → (core::num) → self::A<core::num>
+ return self::A::bar<core::num>;
+static method test10() → (core::int) → self::A<core::int>
+ return self::A::bar<core::int>;
+static method test11() → (core::String) → self::A<dynamic>
+ return self::A::bar<core::String>;
+static method test12() → (core::num) → self::A<dynamic>
+ return self::A::bar<core::num>;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.textual_outline.expect b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.textual_outline.expect
index 11dd004..53e6fd0 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.textual_outline.expect
@@ -1,6 +1,7 @@
class A<X extends num> {
A.foo(X x) {}
A(X x) {}
+ factory A.bar(X x) => new A<X>(x);
}
A<num> Function(num) test1() => A.foo;
A<int> Function(int) test2() => A.foo;
@@ -10,4 +11,8 @@
A<dynamic> Function(String) test6() => A.new;
A<dynamic> Function(num) test7() => A<num>.foo;
A<dynamic> Function(num) test8() => A<num>.new;
+A<num> Function(num) test9() => A.bar;
+A<int> Function(int) test10() => A.bar;
+A<dynamic> Function(String) test11() => A.bar;
+A<dynamic> Function(num) test12() => A.bar;
main() {}
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 86f5a15..33ffc2b 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.expect
@@ -2,7 +2,7 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:15:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
+// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:16:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/instantiation.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// A<dynamic> Function(String) test5() => A.foo; // Error.
@@ -11,7 +11,7 @@
// class A<X extends num> {
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:16:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
+// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:17:40: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/instantiation.dart'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// A<dynamic> Function(String) test6() => A.new; // Error.
@@ -20,6 +20,12 @@
// class A<X extends num> {
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/instantiation.dart:23:41: Error: Inferred type argument 'String' doesn't conform to the bound 'num' of the type variable 'X' on 'A<X> Function<X extends num>(X)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/instantiation.dart'.
+// Try specifying type arguments explicitly so that they conform to the bounds.
+// A<dynamic> Function(String) test11() => A.bar; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -28,6 +34,8 @@
: super core::Object::•() {}
constructor •(self::A::X x) → self::A<self::A::X>
: super core::Object::•() {}
+ static factory bar<X extends core::num>(self::A::bar::X x) → self::A<self::A::bar::X>
+ return new self::A::•<self::A::bar::X>(x);
}
static method test1() → (core::num) → self::A<core::num>
return self::A::foo<core::num>;
@@ -45,4 +53,12 @@
return self::A::foo<core::num>;
static method test8() → (core::num) → self::A<dynamic>
return self::A::•<core::num>;
+static method test9() → (core::num) → self::A<core::num>
+ return self::A::bar<core::num>;
+static method test10() → (core::int) → self::A<core::int>
+ return self::A::bar<core::int>;
+static method test11() → (core::String) → self::A<dynamic>
+ return self::A::bar<core::String>;
+static method test12() → (core::num) → self::A<dynamic>
+ return self::A::bar<core::num>;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.outline.expect b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.outline.expect
index c33b72e..0732d3a 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/instantiation.dart.weak.outline.expect
@@ -7,6 +7,8 @@
;
constructor •(self::A::X x) → self::A<self::A::X>
;
+ static factory bar<X extends core::num>(self::A::bar::X x) → self::A<self::A::bar::X>
+ ;
}
static method test1() → (core::num) → self::A<core::num>
;
@@ -24,5 +26,13 @@
;
static method test8() → (core::num) → self::A<dynamic>
;
+static method test9() → (core::num) → self::A<core::num>
+ ;
+static method test10() → (core::int) → self::A<core::int>
+ ;
+static method test11() → (core::String) → self::A<dynamic>
+ ;
+static method test12() → (core::num) → self::A<dynamic>
+ ;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart
index 32eda21..13751cf 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart
@@ -6,11 +6,14 @@
A.foo1() {}
A.foo2(int x) {}
A() {}
+ factory A.bar1() => new A();
}
A Function() test1() => A.foo1; // Ok.
A Function() test2() => A.foo2; // Error.
A Function() test3() => A.new; // Ok.
A Function(int) test4() => A.new; // Error.
+A Function() test5() => A.bar1; // Ok.
+A Function(int) test6() => A.bar1; // Error.
main() {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.strong.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.strong.expect
index c87e29d..f6026a2 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.strong.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.strong.expect
@@ -2,16 +2,21 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:12:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:13:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
// A Function() test2() => A.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:14:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:15:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
// A Function(int) test4() => A.new; // Error.
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:17:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
+// A Function(int) test6() => A.bar1; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -22,19 +27,28 @@
: super core::Object::•() {}
constructor •() → self::A
: super core::Object::•() {}
+ static factory bar1() → self::A
+ return new self::A::•();
}
static method test1() → () → self::A
return self::A::foo1;
static method test2() → () → self::A
- return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:12:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:13:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
A Function() test2() => A.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} () → self::A;
static method test3() → () → self::A
return self::A::•;
static method test4() → (core::int) → self::A
- return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:14:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:15:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
A Function(int) test4() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} (core::int) → self::A;
+static method test5() → () → self::A
+ return self::A::bar1;
+static method test6() → (core::int) → self::A
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:17:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
+A Function(int) test6() => A.bar1; // Error.
+ ^" in self::A::bar1 as{TypeError,ForNonNullableByDefault} (core::int) → self::A;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.strong.transformed.expect
index c87e29d..f6026a2 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.strong.transformed.expect
@@ -2,16 +2,21 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:12:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:13:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
// A Function() test2() => A.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:14:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:15:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
// A Function(int) test4() => A.new; // Error.
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:17:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
+// A Function(int) test6() => A.bar1; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -22,19 +27,28 @@
: super core::Object::•() {}
constructor •() → self::A
: super core::Object::•() {}
+ static factory bar1() → self::A
+ return new self::A::•();
}
static method test1() → () → self::A
return self::A::foo1;
static method test2() → () → self::A
- return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:12:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:13:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
A Function() test2() => A.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} () → self::A;
static method test3() → () → self::A
return self::A::•;
static method test4() → (core::int) → self::A
- return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:14:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:15:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
A Function(int) test4() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} (core::int) → self::A;
+static method test5() → () → self::A
+ return self::A::bar1;
+static method test6() → (core::int) → self::A
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:17:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
+A Function(int) test6() => A.bar1; // Error.
+ ^" in self::A::bar1 as{TypeError,ForNonNullableByDefault} (core::int) → self::A;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.textual_outline.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.textual_outline.expect
index 9ff49d9..8667cb7 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.textual_outline.expect
@@ -2,9 +2,12 @@
A.foo1() {}
A.foo2(int x) {}
A() {}
+ factory A.bar1() => new A();
}
A Function() test1() => A.foo1;
A Function() test2() => A.foo2;
A Function() test3() => A.new;
A Function(int) test4() => A.new;
+A Function() test5() => A.bar1;
+A Function(int) test6() => A.bar1;
main() {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.expect
index c87e29d..f6026a2 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.expect
@@ -2,16 +2,21 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:12:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:13:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
// A Function() test2() => A.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:14:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:15:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
// A Function(int) test4() => A.new; // Error.
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:17:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
+// A Function(int) test6() => A.bar1; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -22,19 +27,28 @@
: super core::Object::•() {}
constructor •() → self::A
: super core::Object::•() {}
+ static factory bar1() → self::A
+ return new self::A::•();
}
static method test1() → () → self::A
return self::A::foo1;
static method test2() → () → self::A
- return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:12:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:13:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
A Function() test2() => A.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} () → self::A;
static method test3() → () → self::A
return self::A::•;
static method test4() → (core::int) → self::A
- return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:14:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:15:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
A Function(int) test4() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} (core::int) → self::A;
+static method test5() → () → self::A
+ return self::A::bar1;
+static method test6() → (core::int) → self::A
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:17:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
+A Function(int) test6() => A.bar1; // Error.
+ ^" in self::A::bar1 as{TypeError,ForNonNullableByDefault} (core::int) → self::A;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.outline.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.outline.expect
index 72f6e7a..4e2ac21 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.outline.expect
@@ -9,6 +9,8 @@
;
constructor •() → self::A
;
+ static factory bar1() → self::A
+ ;
}
static method test1() → () → self::A
;
@@ -18,5 +20,9 @@
;
static method test4() → (core::int) → self::A
;
+static method test5() → () → self::A
+ ;
+static method test6() → (core::int) → self::A
+ ;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.transformed.expect
index c87e29d..f6026a2 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.transformed.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart.weak.transformed.expect
@@ -2,16 +2,21 @@
//
// Problems in library:
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:12:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:13:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
// A Function() test2() => A.foo2; // Error.
// ^
//
-// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:14:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:15:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
// A Function(int) test4() => A.new; // Error.
// ^
//
+// pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:17:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+// - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
+// A Function(int) test6() => A.bar1; // Error.
+// ^
+//
import self as self;
import "dart:core" as core;
@@ -22,19 +27,28 @@
: super core::Object::•() {}
constructor •() → self::A
: super core::Object::•() {}
+ static factory bar1() → self::A
+ return new self::A::•();
}
static method test1() → () → self::A
return self::A::foo1;
static method test2() → () → self::A
- return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:12:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
+ return let final Never #t1 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:13:25: Error: A value of type 'A Function(int)' can't be returned from a function with return type 'A Function()'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
A Function() test2() => A.foo2; // Error.
^" in self::A::foo2 as{TypeError,ForNonNullableByDefault} () → self::A;
static method test3() → () → self::A
return self::A::•;
static method test4() → (core::int) → self::A
- return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:14:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+ return let final Never #t2 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:15:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
- 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
A Function(int) test4() => A.new; // Error.
^" in self::A::• as{TypeError,ForNonNullableByDefault} (core::int) → self::A;
+static method test5() → () → self::A
+ return self::A::bar1;
+static method test6() → (core::int) → self::A
+ return let final Never #t3 = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart:17:28: Error: A value of type 'A Function()' can't be returned from a function with return type 'A Function(int)'.
+ - 'A' is from 'pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_with_context.dart'.
+A Function(int) test6() => A.bar1; // Error.
+ ^" in self::A::bar1 as{TypeError,ForNonNullableByDefault} (core::int) → self::A;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart
index d132fae..523f030 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart
@@ -5,12 +5,15 @@
class A {
A.foo() {}
A() {}
+ factory A.bar() => new A();
}
testFoo() => A.foo; // Ok.
testNew() => A.new; // Ok.
+testBar() => A.bar; // Ok.
testFooExtraArgs() => A<int>.foo; // Error.
testNewExtraArgs() => A<int>.new; // Error.
+testBarExtraArgs() => A<int>.bar; // Error.
main() {}
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 c89079b..96005b5 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
@@ -7,13 +7,19 @@
: super core::Object::•() {}
constructor •() → self::A
: super core::Object::•() {}
+ static factory bar() → self::A
+ return new self::A::•();
}
static method testFoo() → dynamic
return self::A::foo;
static method testNew() → dynamic
return self::A::•;
+static method testBar() → dynamic
+ return self::A::bar;
static method testFooExtraArgs() → dynamic
return self::A::foo;
static method testNewExtraArgs() → dynamic
return self::A::•;
+static method testBarExtraArgs() → dynamic
+ return self::A::bar;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.strong.transformed.expect
index c89079b..96005b5 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
@@ -7,13 +7,19 @@
: super core::Object::•() {}
constructor •() → self::A
: super core::Object::•() {}
+ static factory bar() → self::A
+ return new self::A::•();
}
static method testFoo() → dynamic
return self::A::foo;
static method testNew() → dynamic
return self::A::•;
+static method testBar() → dynamic
+ return self::A::bar;
static method testFooExtraArgs() → dynamic
return self::A::foo;
static method testNewExtraArgs() → dynamic
return self::A::•;
+static method testBarExtraArgs() → dynamic
+ return self::A::bar;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.textual_outline.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.textual_outline.expect
index 7f58e61..7cdb5cd 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.textual_outline.expect
@@ -1,9 +1,12 @@
class A {
A.foo() {}
A() {}
+ factory A.bar() => new A();
}
testFoo() => A.foo;
testNew() => A.new;
+testBar() => A.bar;
testFooExtraArgs() => A<int>.foo;
testNewExtraArgs() => A<int>.new;
+testBarExtraArgs() => A<int>.bar;
main() {}
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 c89079b..96005b5 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
@@ -7,13 +7,19 @@
: super core::Object::•() {}
constructor •() → self::A
: super core::Object::•() {}
+ static factory bar() → self::A
+ return new self::A::•();
}
static method testFoo() → dynamic
return self::A::foo;
static method testNew() → dynamic
return self::A::•;
+static method testBar() → dynamic
+ return self::A::bar;
static method testFooExtraArgs() → dynamic
return self::A::foo;
static method testNewExtraArgs() → dynamic
return self::A::•;
+static method testBarExtraArgs() → dynamic
+ return self::A::bar;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.outline.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.outline.expect
index f5e6c30..d526768 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.outline.expect
+++ b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.outline.expect
@@ -7,14 +7,20 @@
;
constructor •() → self::A
;
+ static factory bar() → self::A
+ ;
}
static method testFoo() → dynamic
;
static method testNew() → dynamic
;
+static method testBar() → dynamic
+ ;
static method testFooExtraArgs() → dynamic
;
static method testNewExtraArgs() → dynamic
;
+static method testBarExtraArgs() → dynamic
+ ;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.transformed.expect b/pkg/front_end/testcases/constructor_tearoffs/nongeneric_tearoff_without_context.dart.weak.transformed.expect
index c89079b..96005b5 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
@@ -7,13 +7,19 @@
: super core::Object::•() {}
constructor •() → self::A
: super core::Object::•() {}
+ static factory bar() → self::A
+ return new self::A::•();
}
static method testFoo() → dynamic
return self::A::foo;
static method testNew() → dynamic
return self::A::•;
+static method testBar() → dynamic
+ return self::A::bar;
static method testFooExtraArgs() → dynamic
return self::A::foo;
static method testNewExtraArgs() → dynamic
return self::A::•;
+static method testBarExtraArgs() → dynamic
+ return self::A::bar;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_tearoffs/unnamed_constructor.dart b/pkg/front_end/testcases/constructor_tearoffs/unnamed_constructor.dart
index 681aeae..c8527be 100644
--- a/pkg/front_end/testcases/constructor_tearoffs/unnamed_constructor.dart
+++ b/pkg/front_end/testcases/constructor_tearoffs/unnamed_constructor.dart
@@ -24,7 +24,7 @@
D.new(1);
const C.new(1);
new C.new(1);
-
+
var f1 = A.new;
var f2 = B.new;
var f3 = C.new;
diff --git a/pkg/front_end/testcases/general/issue46581.dart b/pkg/front_end/testcases/general/issue46581.dart
new file mode 100644
index 0000000..657b61e
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581.dart
@@ -0,0 +1,13 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'issue46581_lib.dart';
+
+class TestClass extends MyClass with MyMixin {
+ TestClass() : super.named();
+}
+
+mixin MyMixin {}
+
+void main() {}
diff --git a/pkg/front_end/testcases/general/issue46581.dart.textual_outline.expect b/pkg/front_end/testcases/general/issue46581.dart.textual_outline.expect
new file mode 100644
index 0000000..56af166
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581.dart.textual_outline.expect
@@ -0,0 +1,8 @@
+import 'issue46581_lib.dart';
+
+class TestClass extends MyClass with MyMixin {
+ TestClass() : super.named();
+}
+
+mixin MyMixin {}
+void main() {}
diff --git a/pkg/front_end/testcases/general/issue46581.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/issue46581.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..56af166
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581.dart.textual_outline_modelled.expect
@@ -0,0 +1,8 @@
+import 'issue46581_lib.dart';
+
+class TestClass extends MyClass with MyMixin {
+ TestClass() : super.named();
+}
+
+mixin MyMixin {}
+void main() {}
diff --git a/pkg/front_end/testcases/general/issue46581.dart.weak.expect b/pkg/front_end/testcases/general/issue46581.dart.weak.expect
new file mode 100644
index 0000000..e6c9e95
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581.dart.weak.expect
@@ -0,0 +1,36 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "issue46581_lib.dart" as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue46581_lib.dart";
+
+abstract class _TestClass&MyClass&MyMixin = iss::MyClass with self::MyMixin /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor _() → self::_TestClass&MyClass&MyMixin
+ : super iss::MyClass::_()
+ ;
+ const synthetic constructor named() → self::_TestClass&MyClass&MyMixin
+ : super iss::MyClass::named()
+ ;
+}
+class TestClass extends self::_TestClass&MyClass&MyMixin {
+ constructor •() → self::TestClass
+ : super self::_TestClass&MyClass&MyMixin::named()
+ ;
+}
+abstract class MyMixin extends core::Object /*isMixinDeclaration*/ {
+}
+static method main() → void {}
+
+library /*isNonNullableByDefault*/;
+import self as iss;
+import "dart:core" as core;
+
+class MyClass extends core::Object /*hasConstConstructor*/ {
+ const constructor _() → iss::MyClass
+ : super core::Object::•()
+ ;
+ const constructor named() → iss::MyClass
+ : this iss::MyClass::_()
+ ;
+}
diff --git a/pkg/front_end/testcases/general/issue46581.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue46581.dart.weak.outline.expect
new file mode 100644
index 0000000..1c34d9e
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581.dart.weak.outline.expect
@@ -0,0 +1,36 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "issue46581_lib.dart" as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue46581_lib.dart";
+
+abstract class _TestClass&MyClass&MyMixin = iss::MyClass with self::MyMixin /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor _() → self::_TestClass&MyClass&MyMixin
+ : super iss::MyClass::_()
+ ;
+ const synthetic constructor named() → self::_TestClass&MyClass&MyMixin
+ : super iss::MyClass::named()
+ ;
+}
+class TestClass extends self::_TestClass&MyClass&MyMixin {
+ constructor •() → self::TestClass
+ ;
+}
+abstract class MyMixin extends core::Object /*isMixinDeclaration*/ {
+}
+static method main() → void
+ ;
+
+library /*isNonNullableByDefault*/;
+import self as iss;
+import "dart:core" as core;
+
+class MyClass extends core::Object /*hasConstConstructor*/ {
+ const constructor _() → iss::MyClass
+ : super core::Object::•()
+ ;
+ const constructor named() → iss::MyClass
+ : this iss::MyClass::_()
+ ;
+}
diff --git a/pkg/front_end/testcases/general/issue46581.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue46581.dart.weak.transformed.expect
new file mode 100644
index 0000000..4208e93
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581.dart.weak.transformed.expect
@@ -0,0 +1,36 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "issue46581_lib.dart" as iss;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///issue46581_lib.dart";
+
+abstract class _TestClass&MyClass&MyMixin extends iss::MyClass implements self::MyMixin /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/ {
+ const synthetic constructor _() → self::_TestClass&MyClass&MyMixin
+ : super iss::MyClass::_()
+ ;
+ const synthetic constructor named() → self::_TestClass&MyClass&MyMixin
+ : super iss::MyClass::named()
+ ;
+}
+class TestClass extends self::_TestClass&MyClass&MyMixin {
+ constructor •() → self::TestClass
+ : super self::_TestClass&MyClass&MyMixin::named()
+ ;
+}
+abstract class MyMixin extends core::Object /*isMixinDeclaration*/ {
+}
+static method main() → void {}
+
+library /*isNonNullableByDefault*/;
+import self as iss;
+import "dart:core" as core;
+
+class MyClass extends core::Object /*hasConstConstructor*/ {
+ const constructor _() → iss::MyClass
+ : super core::Object::•()
+ ;
+ const constructor named() → iss::MyClass
+ : this iss::MyClass::_()
+ ;
+}
diff --git a/pkg/front_end/testcases/general/issue46581/main.dart b/pkg/front_end/testcases/general/issue46581/main.dart
new file mode 100644
index 0000000..6218cff
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581/main.dart
@@ -0,0 +1,13 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'main_lib.dart';
+
+class TestClass extends MyClass with MyMixin {
+ TestClass() : super.named();
+}
+
+mixin MyMixin {}
+
+void main() {}
diff --git a/pkg/front_end/testcases/general/issue46581/main.dart.textual_outline.expect b/pkg/front_end/testcases/general/issue46581/main.dart.textual_outline.expect
new file mode 100644
index 0000000..187f43d
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581/main.dart.textual_outline.expect
@@ -0,0 +1,8 @@
+import 'main_lib.dart';
+
+class TestClass extends MyClass with MyMixin {
+ TestClass() : super.named();
+}
+
+mixin MyMixin {}
+void main() {}
diff --git a/pkg/front_end/testcases/general/issue46581/main.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/general/issue46581/main.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..187f43d
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581/main.dart.textual_outline_modelled.expect
@@ -0,0 +1,8 @@
+import 'main_lib.dart';
+
+class TestClass extends MyClass with MyMixin {
+ TestClass() : super.named();
+}
+
+mixin MyMixin {}
+void main() {}
diff --git a/pkg/front_end/testcases/general/issue46581/main.dart.weak.expect b/pkg/front_end/testcases/general/issue46581/main.dart.weak.expect
new file mode 100644
index 0000000..15151b3
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581/main.dart.weak.expect
@@ -0,0 +1,36 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_lib.dart" as mai;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///main_lib.dart";
+
+abstract class _TestClass&MyClass&MyMixin = mai::MyClass with self::MyMixin /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor _() → self::_TestClass&MyClass&MyMixin
+ : super mai::MyClass::_()
+ ;
+ const synthetic constructor named() → self::_TestClass&MyClass&MyMixin
+ : super mai::MyClass::named()
+ ;
+}
+class TestClass extends self::_TestClass&MyClass&MyMixin {
+ constructor •() → self::TestClass
+ : super self::_TestClass&MyClass&MyMixin::named()
+ ;
+}
+abstract class MyMixin extends core::Object /*isMixinDeclaration*/ {
+}
+static method main() → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+import "dart:core" as core;
+
+class MyClass extends core::Object /*hasConstConstructor*/ {
+ const constructor _() → mai::MyClass
+ : super core::Object::•()
+ ;
+ const constructor named() → mai::MyClass
+ : this mai::MyClass::_()
+ ;
+}
diff --git a/pkg/front_end/testcases/general/issue46581/main.dart.weak.outline.expect b/pkg/front_end/testcases/general/issue46581/main.dart.weak.outline.expect
new file mode 100644
index 0000000..1579e4a
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581/main.dart.weak.outline.expect
@@ -0,0 +1,36 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_lib.dart" as mai;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///main_lib.dart";
+
+abstract class _TestClass&MyClass&MyMixin = mai::MyClass with self::MyMixin /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor _() → self::_TestClass&MyClass&MyMixin
+ : super mai::MyClass::_()
+ ;
+ const synthetic constructor named() → self::_TestClass&MyClass&MyMixin
+ : super mai::MyClass::named()
+ ;
+}
+class TestClass extends self::_TestClass&MyClass&MyMixin {
+ constructor •() → self::TestClass
+ ;
+}
+abstract class MyMixin extends core::Object /*isMixinDeclaration*/ {
+}
+static method main() → void
+ ;
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+import "dart:core" as core;
+
+class MyClass extends core::Object /*hasConstConstructor*/ {
+ const constructor _() → mai::MyClass
+ : super core::Object::•()
+ ;
+ const constructor named() → mai::MyClass
+ : this mai::MyClass::_()
+ ;
+}
diff --git a/pkg/front_end/testcases/general/issue46581/main.dart.weak.transformed.expect b/pkg/front_end/testcases/general/issue46581/main.dart.weak.transformed.expect
new file mode 100644
index 0000000..11ac66c
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581/main.dart.weak.transformed.expect
@@ -0,0 +1,36 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "main_lib.dart" as mai;
+import "dart:core" as core;
+
+import "org-dartlang-testcase:///main_lib.dart";
+
+abstract class _TestClass&MyClass&MyMixin extends mai::MyClass implements self::MyMixin /*isAnonymousMixin,isEliminatedMixin,hasConstConstructor*/ {
+ const synthetic constructor _() → self::_TestClass&MyClass&MyMixin
+ : super mai::MyClass::_()
+ ;
+ const synthetic constructor named() → self::_TestClass&MyClass&MyMixin
+ : super mai::MyClass::named()
+ ;
+}
+class TestClass extends self::_TestClass&MyClass&MyMixin {
+ constructor •() → self::TestClass
+ : super self::_TestClass&MyClass&MyMixin::named()
+ ;
+}
+abstract class MyMixin extends core::Object /*isMixinDeclaration*/ {
+}
+static method main() → void {}
+
+library /*isNonNullableByDefault*/;
+import self as mai;
+import "dart:core" as core;
+
+class MyClass extends core::Object /*hasConstConstructor*/ {
+ const constructor _() → mai::MyClass
+ : super core::Object::•()
+ ;
+ const constructor named() → mai::MyClass
+ : this mai::MyClass::_()
+ ;
+}
diff --git a/pkg/front_end/testcases/general/issue46581/main_lib.dart b/pkg/front_end/testcases/general/issue46581/main_lib.dart
new file mode 100644
index 0000000..d7138ed
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581/main_lib.dart
@@ -0,0 +1,8 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class MyClass {
+ const MyClass._();
+ const MyClass.named() : this._();
+}
diff --git a/pkg/front_end/testcases/general/issue46581/test.options b/pkg/front_end/testcases/general/issue46581/test.options
new file mode 100644
index 0000000..bfe6dc8
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581/test.options
@@ -0,0 +1 @@
+main_lib.dart
\ No newline at end of file
diff --git a/pkg/front_end/testcases/general/issue46581_lib.dart b/pkg/front_end/testcases/general/issue46581_lib.dart
new file mode 100644
index 0000000..d7138ed
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue46581_lib.dart
@@ -0,0 +1,8 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class MyClass {
+ const MyClass._();
+ const MyClass.named() : this._();
+}
diff --git a/runtime/platform/utils.h b/runtime/platform/utils.h
index 98f1a1c..a1d6b1b 100644
--- a/runtime/platform/utils.h
+++ b/runtime/platform/utils.h
@@ -229,12 +229,22 @@
return value <= limit;
}
- // Check whether the magnitude of value fits in N bits, i.e., whether an
- // (N+1)-bit sign-magnitude representation can hold value.
+ // Check whether the magnitude of value fits in N bits. This differs from
+ // IsInt(N + 1, value) only in that this returns false for the minimum value
+ // of a N+1 bit two's complement value.
+ //
+ // Primarily used for testing whether a two's complement value can be used in
+ // a place where the sign is replaced with a marker that says whether the
+ // magnitude is added or subtracted, e.g., the U bit (bit 23) in some ARM7
+ // instructions.
template <typename T>
- static inline bool IsAbsoluteUint(intptr_t N, T value) {
+ static inline bool MagnitudeIsUint(intptr_t N, T value) {
ASSERT(N >= 1);
- return IsInt(N + 1, value);
+ if constexpr (std::is_signed<T>::value) {
+ using Unsigned = typename std::make_unsigned<T>::type;
+ if (value < 0) return IsUint<Unsigned>(N, -value);
+ }
+ return IsUint(N, value);
}
static inline int32_t Low16Bits(int32_t value) {
diff --git a/runtime/vm/compiler/assembler/assembler_arm.cc b/runtime/vm/compiler/assembler/assembler_arm.cc
index 7cf8272..d285792 100644
--- a/runtime/vm/compiler/assembler/assembler_arm.cc
+++ b/runtime/vm/compiler/assembler/assembler_arm.cc
@@ -2336,19 +2336,20 @@
case kUnsignedTwoBytes:
case kWordPair: {
*offset_mask = 0xff;
- return Utils::IsAbsoluteUint(8, offset); // Addressing mode 3.
+ return Utils::MagnitudeIsUint(8, offset); // Addressing mode 3.
}
case kUnsignedByte:
case kFourBytes:
case kUnsignedFourBytes: {
*offset_mask = 0xfff;
- return Utils::IsAbsoluteUint(12, offset); // Addressing mode 2.
+ return Utils::MagnitudeIsUint(12, offset); // Addressing mode 2.
}
case kSWord:
case kDWord: {
*offset_mask = 0x3fc; // Multiple of 4.
// VFP addressing mode.
- return (Utils::IsAbsoluteUint(10, offset) && Utils::IsAligned(offset, 4));
+ return (Utils::MagnitudeIsUint(10, offset) &&
+ Utils::IsAligned(offset, 4));
}
case kRegList: {
*offset_mask = 0x0;
@@ -2369,20 +2370,21 @@
case kUnsignedTwoBytes:
case kWordPair: {
*offset_mask = 0xff;
- return Utils::IsAbsoluteUint(8, offset); // Addressing mode 3.
+ return Utils::MagnitudeIsUint(8, offset); // Addressing mode 3.
}
case kByte:
case kUnsignedByte:
case kFourBytes:
case kUnsignedFourBytes: {
*offset_mask = 0xfff;
- return Utils::IsAbsoluteUint(12, offset); // Addressing mode 2.
+ return Utils::MagnitudeIsUint(12, offset); // Addressing mode 2.
}
case kSWord:
case kDWord: {
*offset_mask = 0x3fc; // Multiple of 4.
// VFP addressing mode.
- return (Utils::IsAbsoluteUint(10, offset) && Utils::IsAligned(offset, 4));
+ return (Utils::MagnitudeIsUint(10, offset) &&
+ Utils::IsAligned(offset, 4));
}
case kRegList: {
*offset_mask = 0x0;
diff --git a/runtime/vm/compiler/assembler/assembler_arm.h b/runtime/vm/compiler/assembler/assembler_arm.h
index 09162f4..c41b62d 100644
--- a/runtime/vm/compiler/assembler/assembler_arm.h
+++ b/runtime/vm/compiler/assembler/assembler_arm.h
@@ -238,7 +238,7 @@
}
explicit Address(Register rn, int32_t offset = 0, Mode am = Offset) {
- ASSERT(Utils::IsAbsoluteUint(12, offset));
+ ASSERT(Utils::MagnitudeIsUint(12, offset));
kind_ = Immediate;
if (offset < 0) {
encoding_ = (am ^ (1 << kUShift)) | -offset; // Flip U to adjust sign.
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
index 979db7e..b71c702 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
@@ -712,7 +712,7 @@
} else {
__ add(LR, DISPATCH_TABLE_REG,
compiler::Operand(cid_reg, LSL, compiler::target::kWordSizeLog2));
- if (!Utils::IsAbsoluteUint(12, offset)) {
+ if (!Utils::MagnitudeIsUint(12, offset)) {
const intptr_t adjust = offset & -(1 << 12);
__ AddImmediate(LR, LR, adjust);
offset -= adjust;
diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc
index 80aaa47..0c07ad2 100644
--- a/runtime/vm/compiler/backend/il_arm.cc
+++ b/runtime/vm/compiler/backend/il_arm.cc
@@ -1855,7 +1855,7 @@
const intptr_t base_offset =
(is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
const int64_t offset = index * scale + base_offset;
- if (!Utils::IsAbsoluteUint(12, offset)) {
+ if (!Utils::MagnitudeIsUint(12, offset)) {
return false;
}
if (compiler::Address::CanHoldImmediateOffset(is_load, cid, offset)) {
diff --git a/runtime/vm/datastream.cc b/runtime/vm/datastream.cc
index 6d398fe..2dde0cf 100644
--- a/runtime/vm/datastream.cc
+++ b/runtime/vm/datastream.cc
@@ -10,8 +10,7 @@
namespace dart {
void BaseWriteStream::WriteTargetWord(word value) {
- ASSERT(compiler::target::kBitsPerWord == kBitsPerWord ||
- Utils::IsAbsoluteUint(compiler::target::kBitsPerWord, value));
+ ASSERT(Utils::BitLength(value) <= compiler::target::kBitsPerWord);
WriteFixed(static_cast<compiler::target::word>(value));
}
diff --git a/runtime/vm/image_snapshot.cc b/runtime/vm/image_snapshot.cc
index 658892b..6be60de 100644
--- a/runtime/vm/image_snapshot.cc
+++ b/runtime/vm/image_snapshot.cc
@@ -1207,8 +1207,7 @@
}
intptr_t AssemblyImageWriter::WriteTargetWord(word value) {
- ASSERT(compiler::target::kBitsPerWord == kBitsPerWord ||
- Utils::IsAbsoluteUint(compiler::target::kBitsPerWord, value));
+ ASSERT(Utils::BitLength(value) <= compiler::target::kBitsPerWord);
// Padding is helpful for comparing the .S with --disassemble.
assembly_stream_->Printf("%s 0x%.*" Px "\n", kWordDirective,
2 * compiler::target::kWordSize, value);
diff --git a/runtime/vm/utils_test.cc b/runtime/vm/utils_test.cc
index ba4e296..2b0369f 100644
--- a/runtime/vm/utils_test.cc
+++ b/runtime/vm/utils_test.cc
@@ -290,22 +290,26 @@
EXPECT(!Utils::IsUint(32, 4294967296LL));
}
-VM_UNIT_TEST_CASE(IsAbsoluteUint) {
- EXPECT(Utils::IsAbsoluteUint(8, 16));
- EXPECT(Utils::IsAbsoluteUint(8, 0));
- EXPECT(Utils::IsAbsoluteUint(8, -128));
- EXPECT(Utils::IsAbsoluteUint(8, 255));
- EXPECT(!Utils::IsAbsoluteUint(8, 256));
- EXPECT(Utils::IsAbsoluteUint(16, 16));
- EXPECT(Utils::IsAbsoluteUint(16, 0));
- EXPECT(Utils::IsAbsoluteUint(16, 65535));
- EXPECT(Utils::IsAbsoluteUint(16, -32768));
- EXPECT(!Utils::IsAbsoluteUint(16, 65536));
- EXPECT(Utils::IsAbsoluteUint(32, 16LL));
- EXPECT(Utils::IsAbsoluteUint(32, 0LL));
- EXPECT(Utils::IsAbsoluteUint(32, -2147483648LL));
- EXPECT(Utils::IsAbsoluteUint(32, 4294967295LL));
- EXPECT(!Utils::IsAbsoluteUint(32, 4294967296LL));
+VM_UNIT_TEST_CASE(MagnitudeIsUint) {
+ EXPECT(Utils::MagnitudeIsUint(8, 16));
+ EXPECT(Utils::MagnitudeIsUint(8, 0));
+ EXPECT(Utils::MagnitudeIsUint(8, -128));
+ EXPECT(Utils::MagnitudeIsUint(8, 255));
+ EXPECT(!Utils::MagnitudeIsUint(8, 256));
+ EXPECT(Utils::MagnitudeIsUint(12, 4095));
+ EXPECT(Utils::MagnitudeIsUint(12, -4095));
+ EXPECT(!Utils::MagnitudeIsUint(12, 4096));
+ EXPECT(!Utils::MagnitudeIsUint(12, -4096));
+ EXPECT(Utils::MagnitudeIsUint(16, 16));
+ EXPECT(Utils::MagnitudeIsUint(16, 0));
+ EXPECT(Utils::MagnitudeIsUint(16, 65535));
+ EXPECT(Utils::MagnitudeIsUint(16, -32768));
+ EXPECT(!Utils::MagnitudeIsUint(16, 65536));
+ EXPECT(Utils::MagnitudeIsUint(32, 16LL));
+ EXPECT(Utils::MagnitudeIsUint(32, 0LL));
+ EXPECT(Utils::MagnitudeIsUint(32, -2147483648LL));
+ EXPECT(Utils::MagnitudeIsUint(32, 4294967295LL));
+ EXPECT(!Utils::MagnitudeIsUint(32, 4294967296LL));
}
VM_UNIT_TEST_CASE(LowBits) {
diff --git a/tools/VERSION b/tools/VERSION
index 44af46c..d80c7ef 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 290
+PRERELEASE 291
PRERELEASE_PATCH 0
\ No newline at end of file