Fixed Issue #465: New tests for overriding added.
diff --git a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t05.dart b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t05.dart
index 7b0cb26..6bc1a71 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t05.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t05.dart
@@ -23,7 +23,7 @@
import "override_checking_A01_opted_in_lib.dart";
class A extends OPTED_NEVER_ARGS {
- void test_never(Never i) { Expect.isNull(i); }
+ void test_never(Null i) { Expect.isNull(i); }
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t11.dart b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t11.dart
index e7ebe4c..f7707a0 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t11.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t11.dart
@@ -23,7 +23,7 @@
import "override_checking_A01_opted_in_lib.dart";
class A implements OPTED_NEVER_ARGS {
- void test_never(Never i) { Expect.isNull(i); }
+ void test_never(Null i) { Expect.isNull(i); }
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t17.dart b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t17.dart
index 562a1ae..66e8cf1 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t17.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t17.dart
@@ -23,7 +23,7 @@
import "override_checking_A01_opted_in_lib.dart";
class A with OPTED_NEVER_ARGS {
- void test_never(Never i) { Expect.isNull(i); }
+ void test_never(Null i) { Expect.isNull(i); }
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t19.dart b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t19.dart
new file mode 100644
index 0000000..91c2a49
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t19.dart
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can accept non-null argument if corresponding
+ * parent method argument is of non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B {
+ void test_int(int i) { Expect.equals(1, i); }
+ void test_object(Object o) { Expect.equals(1, o); }
+ void test_function(Function f) { Expect.equals(testme, f); }
+ void test_futureOr(FutureOr<int> i) { Expect.equals(1, i); }
+}
+
+class A extends B implements OPTED_NONNULLABLE_ARGS {}
+
+void testme() {}
+
+main() {
+ A a = A();
+ a.test_int(1);
+ a.test_object(1);
+ a.test_function(testme);
+ a.test_futureOr(1);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t20.dart b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t20.dart
new file mode 100644
index 0000000..5fb7c0a
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t20.dart
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can accept [null] arguments if corresponding
+ * parent method argument is of non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B {
+ void test_int(int i) { Expect.isNull(i); }
+ void test_object(Object o) { Expect.isNull(o); }
+ void test_function(Function f) { Expect.isNull(f); }
+ void test_futureOr(FutureOr<int> f) { Expect.isNull(f); }
+}
+
+class A extends B implements OPTED_NONNULLABLE_ARGS {}
+
+main() {
+ A a = A();
+ a.test_int(null);
+ a.test_object(null);
+ a.test_function(null);
+ a.test_futureOr(null);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t21.dart b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t21.dart
new file mode 100644
index 0000000..ac0fb44
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t21.dart
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can accept non-null arguments if corresponding
+ * parent method argument is of nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B {
+ void test_int(int i) { Expect.equals(1, i); }
+ void test_object(Object o) { Expect.equals(1, o); }
+ void test_dynamic(dynamic d) { Expect.equals(1, d); }
+ void test_function(Function f) { Expect.equals(testme, f); }
+ void test_futureOr(FutureOr f) { Expect.equals(1, f); }
+}
+
+class A extends B implements OPTED_NULLABLE_ARGS {
+ void test_null(Null n) {}
+}
+
+void testme() {}
+
+main() {
+ A a = A();
+ a.test_int(1);
+ a.test_object(1);
+ a.test_dynamic(1);
+ a.test_function(testme);
+ a.test_futureOr(1);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t22.dart b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t22.dart
new file mode 100644
index 0000000..54b49c8
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t22.dart
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can accept [null] argument if corresponding
+ * parent method argument is of nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B {
+ void test_int(int i) { Expect.isNull(i); }
+ void test_object(Object o) { Expect.isNull(o); }
+ void test_function(Function f) { Expect.isNull(f); }
+ void test_dynamic(dynamic d) { Expect.isNull(d); }
+ void test_futureOr(FutureOr f) { Expect.isNull(f); }
+ void test_null(Null n) { Expect.isNull(n); }
+}
+
+class A extends B implements OPTED_NULLABLE_ARGS {}
+
+main() {
+ A a = A();
+ a.test_int(null);
+ a.test_object(null);
+ a.test_dynamic(null);
+ a.test_function(null);
+ a.test_futureOr(null);
+ a.test_null(null);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t23.dart b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t23.dart
new file mode 100644
index 0000000..cd7dcda
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t23.dart
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can accept [Null] argument if corresponding
+ * parent method argument is of [Never] type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B {
+ void test_never(Null i) { Expect.isNull(i); }
+}
+
+class A extends B implements OPTED_NEVER_ARGS {}
+
+main() {
+ A a = A();
+ a.test_never(null);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_ARGS_t24.dart b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t24.dart
new file mode 100644
index 0000000..df8a37f
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_ARGS_t24.dart
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can accept non-null argument if corresponding
+ * parent method argument is of [Never] type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NEVER_ARGS {}
+
+class B {
+ void test_never(int i) { Expect.equals(1, i); }
+}
+
+main() {
+ A a = A();
+ a.test_never(1);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t31.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t31.dart
new file mode 100644
index 0000000..d716481
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t31.dart
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if generic legacy class extends legacy class and
+ * implements generic opted-in class, legacy type parameter is OK and the fact
+ * that parent opted-in interface type parameter is non-nullable is ignored.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B1<T> { dynamic getParamType() => typeOf<T>(); }
+class B2<T> { dynamic getParamType() => typeOf<T>(); }
+class B3<T> { dynamic getParamType() => typeOf<T>(); }
+
+class A1<T extends int > extends B1<T> implements OPTED_NONNULLABLE_INT<T> {}
+class A2<T extends Object > extends B2<T> implements OPTED_NONNULLABLE_OBJECT<T> {}
+class A3<T extends Function> extends B3<T> implements OPTED_NONNULLABLE_FUNCTION<T> {}
+
+main() {
+ Expect.equals(int, A1().getParamType());
+ Expect.equals(int, A1<int>().getParamType());
+
+ Expect.equals(Object, A2().getParamType());
+ Expect.equals(Object, A2<Object>().getParamType());
+
+ Expect.equals(Function, A3().getParamType());
+ Expect.equals(Function, A3<Function>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t32.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t32.dart
new file mode 100644
index 0000000..22cb20f
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t32.dart
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if generic legacy class extends legacy class and
+ * implements opted-in class, all nullability annotations in the parent interface
+ * are ignored in the child class and child class type parameter can be [Null]
+ * even if parent class type parameter is non-nullable.
+ *
+ * @Issue 40398
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B1<T> { dynamic getParamType() => typeOf<T>(); }
+class B2<T> { dynamic getParamType() => typeOf<T>(); }
+class B3<T> { dynamic getParamType() => typeOf<T>(); }
+
+class A1<T extends Null> extends B1<T> implements OPTED_NONNULLABLE_INT<T> {}
+class A2<T extends Null> extends B2<T> implements OPTED_NONNULLABLE_OBJECT<T> {}
+class A3<T extends Null> extends B3<T> implements OPTED_NONNULLABLE_FUNCTION<T> {}
+
+main() {
+ Expect.equals(Null, A1().getParamType());
+ Expect.equals(Null, A1<Null>().getParamType());
+
+ Expect.equals(Null, A2().getParamType());
+ Expect.equals(Null, A2<Null>().getParamType());
+
+ Expect.equals(Null, A3().getParamType());
+ Expect.equals(Null, A3<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t33.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t33.dart
new file mode 100644
index 0000000..ed9d619
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t33.dart
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if generic legacy class extends legacy class and
+ * implements generic opted-in class with [FutureOr] class type parameter,
+ * legacy type parameter is OK and the fact that parent interface type parameter
+ * is non-nullable is ignored.
+ *
+ * @Issue 39666.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_futureor_lib.dart";
+
+class B<T> { dynamic getParamType() => typeOf<T>(); }
+class A<T extends FutureOr<int>> extends B<T> implements OPTED_FUTUREOR_INT<T> {}
+
+main() {
+ Expect.equals( typeOf<FutureOr<int>>(), A().getParamType());
+ Expect.equals( typeOf<FutureOr<int>>(), A<int>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t34.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t34.dart
new file mode 100644
index 0000000..5c2d2a2
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t34.dart
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if generic legacy class extends legacy class and
+ * implements generic opted-in class with [FutureOr] class type parameter,
+ * legacy type parameter is OK and can be [Null] even if parent interface type
+ * parameter is non-nullable.
+ *
+ * @Issue 39666.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_futureor_lib.dart";
+
+class B<T> { dynamic getParamType() => typeOf<T>(); }
+class A<T extends Null> extends B<T> implements OPTED_FUTUREOR_INT<T> {}
+
+main() {
+ Expect.equals( Null, A().getParamType());
+ Expect.equals( Null, A<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t35.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t35.dart
new file mode 100644
index 0000000..c740afb
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t35.dart
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if generic legacy class extends legacy class and
+ * implements generic opted-in class, legacy type parameter is OK if parent
+ * interface type parameter is nullable.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B1<T> { dynamic getParamType() => typeOf<T>(); }
+class B2<T> { dynamic getParamType() => typeOf<T>(); }
+class B3<T> { dynamic getParamType() => typeOf<T>(); }
+class B4<T> { dynamic getParamType() => typeOf<T>(); }
+class B5<T> { dynamic getParamType() => typeOf<T>(); }
+
+class A1<T > extends B1<T> implements OPTED_NULLABLE <T> {}
+class A2<T extends dynamic > extends B2<T> implements OPTED_DYNAMIC <T> {}
+class A3<T extends int > extends B3<T> implements OPTED_NULLABLE_INT <T> {}
+class A4<T extends Object > extends B4<T> implements OPTED_NULLABLE_OBJECT <T> {}
+class A5<T extends Function> extends B5<T> implements OPTED_NULLABLE_FUNCTION<T> {}
+
+main() {
+ Expect.equals(dynamic, A1().getParamType());
+ Expect.equals(dynamic, A1<dynamic>().getParamType());
+
+ Expect.equals(dynamic, A2().getParamType());
+ Expect.equals(dynamic, A2<dynamic>().getParamType());
+
+ Expect.equals(int, A3().getParamType());
+ Expect.equals(int, A3<int>().getParamType());
+
+ Expect.equals(Object, A4().getParamType());
+ Expect.equals(Object, A4<Object>().getParamType());
+
+ Expect.equals(Function, A5().getParamType());
+ Expect.equals(Function, A5<Function>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t36.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t36.dart
new file mode 100644
index 0000000..28711e6
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t36.dart
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy generic class extends legacy class and
+ * implements opted-in class, child class type parameter can be [Null] if parent
+ * interface type parameter is nullable.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B1<T> { dynamic getParamType() => typeOf<T>(); }
+class B2<T> { dynamic getParamType() => typeOf<T>(); }
+class B3<T> { dynamic getParamType() => typeOf<T>(); }
+class B4<T> { dynamic getParamType() => typeOf<T>(); }
+class B5<T> { dynamic getParamType() => typeOf<T>(); }
+class B6<T> { dynamic getParamType() => typeOf<T>(); }
+
+class A1<T extends Null> extends B1<T> implements OPTED_NULLABLE <T> {}
+class A2<T extends Null> extends B2<T> implements OPTED_DYNAMIC <T> {}
+class A3<T extends Null> extends B3<T> implements OPTED_NULLABLE_INT <T> {}
+class A4<T extends Null> extends B4<T> implements OPTED_NULLABLE_OBJECT <T> {}
+class A5<T extends Null> extends B5<T> implements OPTED_NULLABLE_FUNCTION<T> {}
+class A6<T extends Null> extends B6<T> implements OPTED_NULL <T> {}
+
+main() {
+ Expect.equals(Null, A1().getParamType());
+ Expect.equals(Null, A1<Null>().getParamType());
+
+ Expect.equals(Null, A2().getParamType());
+ Expect.equals(Null, A2<Null>().getParamType());
+
+ Expect.equals(Null, A3().getParamType());
+ Expect.equals(Null, A3<Null>().getParamType());
+
+ Expect.equals(Null, A4().getParamType());
+ Expect.equals(Null, A4<Null>().getParamType());
+
+ Expect.equals(Null, A5().getParamType());
+ Expect.equals(Null, A5<Null>().getParamType());
+
+ Expect.equals(Null, A6().getParamType());
+ Expect.equals(Null, A6<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t37.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t37.dart
new file mode 100644
index 0000000..6d2ab24
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t37.dart
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if generic legacy class extends legacy class and
+ * implements generic opted-in class, legacy type parameter is OK if parent
+ * interface type parameter is nullable [FutureOr].
+ *
+ * @Issue 39666.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_futureor_lib.dart";
+
+class B1<T> { dynamic getParamType() => typeOf<T>(); }
+class B2<T> { dynamic getParamType() => typeOf<T>(); }
+
+class A1<T extends FutureOr > extends B1<T> implements OPTED_FUTUREOR<T> {}
+class A2<T extends FutureOr<FutureOr>> extends B2<T> implements OPTED_FUTUREOR_FUTUREOR<T> {}
+
+main() {
+ Expect.equals( typeOf<FutureOr>(), A1().getParamType());
+ Expect.equals( typeOf<FutureOr>(), A1<int>().getParamType());
+
+ Expect.equals( typeOf<FutureOr<FutureOr>>(), A2().getParamType());
+ Expect.equals( typeOf<FutureOr<FutureOr>>(), A2<FutureOr<FutureOr>>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t38.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t38.dart
new file mode 100644
index 0000000..e4280ff
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t38.dart
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if generic legacy class extends legacy class and
+ * implements generic opted-in class, legacy type parameter can be [Null] if
+ * parent interface type parameter is nullable [FutureOr].
+ *
+ * @Issue 39666.
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_futureor_lib.dart";
+
+class B1<T> { dynamic getParamType() => typeOf<T>(); }
+class B2<T> { dynamic getParamType() => typeOf<T>(); }
+
+class A1<T extends Null> extends B1<T> implements OPTED_FUTUREOR<T> {}
+class A2<T extends Null> extends B2<T> implements OPTED_FUTUREOR_FUTUREOR<T> {}
+
+main() {
+ Expect.equals( Null, A1().getParamType());
+ Expect.equals( Null, A1<Null>().getParamType());
+
+ Expect.equals( Null, A2().getParamType());
+ Expect.equals( Null, A2<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t39.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t39.dart
new file mode 100644
index 0000000..cc2bd74
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t39.dart
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if generic legacy class extends legacy class and
+ * implements opted-in class, child class type parameter can be [Null] if parent
+ * interface type parameter is [Never].
+ *
+ * Issue 40389
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B<T> { dynamic getParamType() => typeOf<T>(); }
+class A<T extends Null> extends B<T> implements OPTED_NEVER<T> {}
+
+main() {
+ Expect.equals(Null, A().getParamType());
+ Expect.equals(Null, A<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t40.dart b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t40.dart
new file mode 100644
index 0000000..01ae85b
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_CLASSPARAM_t40.dart
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if generic legacy class extends legacy class and
+ * implements opted-in class, child class type parameter cannot be non-Null if
+ * parent interface type parameter is [Never].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "override_checking_A01_opted_in_lib.dart";
+
+class B1<T>{}
+class A1<T> extends B1<T> implements OPTED_NEVER<T> {}
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+class B2<T> {}
+class A2<T extends dynamic> extends B implements OPTED_NEVER<T> {}
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+class B3<T> {}
+class A3<T extends Object> extends B3<T> implements OPTED_NEVER<T> {}
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+class B4<T> {}
+class A4<T extends int> extends B4<T> implements OPTED_NEVER<T> {}
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+main() {
+ A1();
+ A2();
+ A3();
+ A4();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_FIELD_t25.dart b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t25.dart
new file mode 100644
index 0000000..ec59a80
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t25.dart
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy field can accept non-null values if corresponding
+ * parent opted in field is of non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class A extends B implements OPTED_NONNULLABLE_FIELD {}
+
+class B {
+ int i = 1;
+ Object o = 1;
+ Function f = testme1;
+ FutureOr<int> fi = 1;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.i);
+ Expect.equals(1, a.o);
+ Expect.equals(testme1, a.f);
+ Expect.equals(1, a.fi);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_FIELD_t26.dart b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t26.dart
new file mode 100644
index 0000000..9edb2c8
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t26.dart
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy field can accept null values if corresponding parent
+ * opted-in field is of non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NONNULLABLE_FIELD {}
+
+class B {
+ int i = null;
+ Object o = null;
+ Function f = null;
+ FutureOr<int> fi = null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.i);
+ Expect.isNull(a.o);
+ Expect.isNull(a.f);
+ Expect.isNull(a.fi);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_FIELD_t27.dart b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t27.dart
new file mode 100644
index 0000000..7abd2ef
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t27.dart
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy field can be unassigned when corresponding parent
+ * field is of non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NONNULLABLE_FIELD {}
+
+class B {
+ int i;
+ Object o;
+ Function f;
+ FutureOr<int> fi;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.i);
+ Expect.isNull(a.o);
+ Expect.isNull(a.f);
+ Expect.isNull(a.fi);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_FIELD_t28.dart b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t28.dart
new file mode 100644
index 0000000..56f2e32
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t28.dart
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy field can accept non-null values if corresponding
+ * parent field is of nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class A extends B implements OPTED_NULLABLE_FIELD {}
+
+class B {
+ int i = 1;
+ Object o = 1;
+ dynamic d = 1;
+ Function f = testme1;
+ FutureOr fo = 1;
+ Null n = null;
+ void v;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.i);
+ Expect.equals(1, a.o);
+ Expect.equals(1, a.d);
+ Expect.equals(testme1, a.f);
+ Expect.equals(1, a.fo);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_FIELD_t29.dart b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t29.dart
new file mode 100644
index 0000000..4851dd9
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t29.dart
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy field can accept null values if corresponding parent
+ * field is of nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NULLABLE_FIELD {}
+
+class B {
+ int i = null;
+ Object o = null;
+ dynamic d = null;
+ Function f = null;
+ Null n = null;
+ FutureOr fo = null;
+ void v = null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.i);
+ Expect.isNull(a.o);
+ Expect.isNull(a.f);
+ Expect.isNull(a.d);
+ Expect.isNull(a.n);
+ Expect.isNull(a.fo);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_FIELD_t30.dart b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t30.dart
new file mode 100644
index 0000000..540506d
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t30.dart
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy field can be unassigned when corresponding parent
+ * field is of nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NULLABLE_FIELD {}
+
+class B {
+ int i;
+ Object o;
+ dynamic d;
+ Function f;
+ Null n;
+ FutureOr fo;
+ void v;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.i);
+ Expect.isNull(a.o);
+ Expect.isNull(a.f);
+ Expect.isNull(a.d);
+ Expect.isNull(a.n);
+ Expect.isNull(a.fo);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_FIELD_t31.dart b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t31.dart
new file mode 100644
index 0000000..2b64bf3
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t31.dart
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy field can be [Null] if corresponding parent field is
+ * of the type [Never].
+ *
+ * @Issue 40389
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NEVER_FIELD {}
+
+class B {
+ Null n;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.n);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_FIELD_t32.dart b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t32.dart
new file mode 100644
index 0000000..51a6dc0
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_FIELD_t32.dart
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, child legacy field cannot be of any type but [Null] if parent
+ * field is [Never].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "override_checking_A01_opted_in_lib.dart";
+
+class B1 { int n; }
+class A1 extends B1 implements OPTED_NEVER_FIELD {}
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+class B2 { dynamic n; }
+class A2 extends B2 implements OPTED_NEVER_FIELD {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B3 { Object n; }
+class A3 extends B3 implements OPTED_NEVER_FIELD {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B4 { void n; }
+class A4 extends B4 implements OPTED_NEVER_FIELD {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ A1();
+ A2();
+ A3();
+ A4();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_GETTER_t19.dart b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t19.dart
new file mode 100644
index 0000000..1b424d5
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t19.dart
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy getter can return non-null values if corresponding
+ * parent getter is of non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class B {
+ int get getInt => 1;
+ Object get getObject => 1;
+ Function get getFunction => testme1;
+ FutureOr<int> get getFutureOrInt => 1;
+}
+
+class A extends B implements OPTED_NONNULLABLE_GETTER {}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(testme1, a.getFunction);
+ Expect.equals(1, a.getFutureOrInt);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_GETTER_t20.dart b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t20.dart
new file mode 100644
index 0000000..549d008
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t20.dart
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy getter can return [null] if corresponding parent
+ * getter is of non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NONNULLABLE_GETTER {}
+
+class B {
+ int get getInt => null;
+ Object get getObject => null;
+ Function get getFunction => null;
+ FutureOr<int> get getFutureOrInt => null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.getInt);
+ Expect.isNull(a.getObject);
+ Expect.isNull(a.getFunction);
+ Expect.isNull(a.getFutureOrInt);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_GETTER_t21.dart b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t21.dart
new file mode 100644
index 0000000..320660f
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t21.dart
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy getter can return non-null values if corresponding
+ * parent getter is of nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class A extends B implements OPTED_NULLABLE_GETTER {}
+
+class B {
+ int get getInt => 1;
+ Object get getObject => 1;
+ Function get getFunction => testme1;
+ FutureOr get getFutureOr => 1;
+ dynamic get getDynamic => 1;
+ Null get getNull => null;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(testme1, a.getFunction);
+ Expect.equals(1, a.getFutureOr);
+ Expect.equals(1, a.getDynamic);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_GETTER_t22.dart b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t22.dart
new file mode 100644
index 0000000..8aea950
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t22.dart
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy getter can return [null] if corresponding parent
+ * getter is of nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NULLABLE_GETTER {}
+
+class B {
+ int get getInt => null;
+ Object get getObject => null;
+ Function get getFunction => null;
+ FutureOr get getFutureOr => null;
+ dynamic get getDynamic => null;
+ Null get getNull => null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.getInt);
+ Expect.isNull(a.getObject);
+ Expect.isNull(a.getFunction);
+ Expect.isNull(a.getFutureOr);
+ Expect.isNull(a.getDynamic);
+ Expect.isNull(a.getNull);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_GETTER_t23.dart b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t23.dart
new file mode 100644
index 0000000..81ead1d
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t23.dart
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy getter can return [null] if corresponding parent
+ * getter is of the type [Never].
+ *
+ * @Issue 40389
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NEVER_GETTER {}
+
+class B {
+ int get getNever => null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.getNever);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_GETTER_t24.dart b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t24.dart
new file mode 100644
index 0000000..a41cfd1
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_GETTER_t24.dart
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy getter cannot return anything but [null] if
+ * corresponding parent getter is of the type [Never].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class B1 { int get getNever => 1; }
+class A1 extends B1 implements OPTED_NEVER_GETTER {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B2 { dynamic get getNever => 1; }
+class A2 extends B2 implements OPTED_NEVER_GETTER {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B3 { FutureOr get getNever => 1; }
+class A3 extends B3 implements OPTED_NEVER_GETTER {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B4 { Function get getNever => testme1; }
+class A4 extends B4 implements OPTED_NEVER_GETTER {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B5 { Object get getNever => 1; }
+class A5 implements OPTED_NEVER_GETTER {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ A1();
+ A2();
+ A3();
+ A4();
+ A5();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t22.dart b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t22.dart
new file mode 100644
index 0000000..841ad41
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t22.dart
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method with optional named argument with default
+ * non-null value can override method with [required] argument and accept
+ * non-null values.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_REQUIRED_ARGS {}
+
+class B {
+ void test_required_nonnullable({int i = -1}) { Expect.equals(1, i); }
+ void test_required_nullable ({int i = -1}) { Expect.equals(1, i); }
+}
+
+main() {
+ A a = A();
+ a.test_required_nonnullable(i: 1);
+ a.test_required_nullable (i: 1);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t23.dart b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t23.dart
new file mode 100644
index 0000000..3cba0c2
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t23.dart
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method with optional named argument with default
+ * non-null value can override method with [required] argument and accept [null]
+ * values.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_REQUIRED_ARGS {}
+
+class B {
+ void test_required_nonnullable({int i = 1}) { Expect.isNull(i); }
+ void test_required_nullable ({int i = 1}) { Expect.isNull(i); }
+}
+
+main() {
+ A a = A();
+ a.test_required_nonnullable(i: null);
+ a.test_required_nullable (i: null);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t24.dart b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t24.dart
new file mode 100644
index 0000000..40bfb50
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t24.dart
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method with optional named argument with default
+ * non-null value can override method with [required] argument and argument can
+ * be omitted in the method call.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_REQUIRED_ARGS {}
+
+class B {
+ void test_required_nonnullable({int i = 1}) { Expect.equals(1, i); }
+ void test_required_nullable ({int i = 1}) { Expect.equals(1, i); }
+}
+
+main() {
+ A a = A();
+ a.test_required_nonnullable();
+ a.test_required_nullable();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t25.dart b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t25.dart
new file mode 100644
index 0000000..7de465c
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t25.dart
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method with optional named argument with default
+ * [null] value can override method with [required] argument.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_REQUIRED_ARGS {}
+
+class B {
+ void test_required_nonnullable({int i = null}) { Expect.isNull(i); }
+ void test_required_nullable ({int i = null}) { Expect.isNull(i); }
+}
+
+main() {
+ A a = A();
+ a.test_required_nonnullable();
+ a.test_required_nullable();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t26.dart b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t26.dart
new file mode 100644
index 0000000..ac53437
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t26.dart
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method with optional named argument without default
+ * value can override method with [required] argument and accept non-null values.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_REQUIRED_ARGS {}
+
+class B {
+ void test_required_nonnullable({int i}) { Expect.equals(1, i); }
+ void test_required_nullable ({int i}) { Expect.equals(1, i); }
+}
+
+main() {
+ A a = A();
+ a.test_required_nonnullable(i: 1);
+ a.test_required_nullable (i: 1);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t27.dart b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t27.dart
new file mode 100644
index 0000000..e11216d
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t27.dart
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method with optional named argument without default
+ * value can override method with [required] argument and accept [null] values.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_REQUIRED_ARGS {}
+
+class B {
+ void test_required_nonnullable({int i}) { Expect.isNull(i); }
+ void test_required_nullable ({int i}) { Expect.isNull(i); }
+}
+
+main() {
+ A a = A();
+ a.test_required_nonnullable(i: null);
+ a.test_required_nullable (i: null);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t28.dart b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t28.dart
new file mode 100644
index 0000000..375f56a
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_REQ_ARGS_t28.dart
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method with optional named argument without default
+ * value can override method with [required] argument and defaut argument value
+ * is treated as [null] in this case.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_REQUIRED_ARGS {}
+
+class B {
+ void test_required_nonnullable({int i}) { Expect.isNull(i); }
+ void test_required_nullable ({int i}) { Expect.isNull(i); }
+}
+
+main() {
+ A a = A();
+ a.test_required_nonnullable();
+ a.test_required_nullable();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t01.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t01.dart
index 4b67efe..6dede7c 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t01.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t01.dart
@@ -25,10 +25,10 @@
void testme1() {}
class A extends OPTED_NONNULLABLE_RETURN {
- int getInt() { return 1; }
- Object getObject() { return 1; }
- Function getFunction() { return testme1; }
- FutureOr<int> getFutureOrInt() { return 1; }
+ int getInt() => 1;
+ Object getObject() => 1;
+ Function getFunction() => testme1;
+ FutureOr<int> getFutureOrInt() => 1;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t02.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t02.dart
index 373dea3..b72934a 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t02.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t02.dart
@@ -23,10 +23,10 @@
import "override_checking_A01_opted_in_lib.dart";
class A extends OPTED_NONNULLABLE_RETURN {
- int getInt() { return null; }
- Object getObject() { return null; }
- Function getFunction() { return null; }
- FutureOr<int> getFutureOrInt() { return null; }
+ int getInt() => null;
+ Object getObject() => null;
+ Function getFunction() => null;
+ FutureOr<int> getFutureOrInt() => null;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t03.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t03.dart
index 036065c..475898d 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t03.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t03.dart
@@ -25,11 +25,11 @@
void testme1() {}
class A extends OPTED_NULLABLE_RETURN {
- int getInt() { return 1; }
- Object getObject() { return 1; }
- Function getFunction() { return testme1; }
- FutureOr getFutureOr() { return 1; }
- dynamic getDynamic() { return 1; }
+ int getInt() =>1;
+ Object getObject() => 1;
+ Function getFunction() => testme1;
+ FutureOr getFutureOr() => 1;
+ dynamic getDynamic() => 1;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t04.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t04.dart
index c03ddd6..14cc654 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t04.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t04.dart
@@ -23,12 +23,12 @@
import "override_checking_A01_opted_in_lib.dart";
class A extends OPTED_NULLABLE_RETURN {
- int getInt() { return null; }
- Object getObject() { return null; }
- Function getFunction() { return null; }
- FutureOr getFutureOr() { return null; }
- dynamic getDynamic() { return null; }
- Null getNull() { return null; }
+ int getInt() => null;
+ Object getObject() => null;
+ Function getFunction() => null;
+ FutureOr getFutureOr() => null;
+ dynamic getDynamic() => null;
+ Null getNull() => null;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t05.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t05.dart
index a75c86b..0a013a7 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t05.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t05.dart
@@ -24,7 +24,7 @@
import "override_checking_A01_opted_in_lib.dart";
class A extends OPTED_NEVER_RETURN {
- Null getNever() { return null; }
+ Null getNever() => null;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t06.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t06.dart
index 8fb0599..8e8f153 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t06.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t06.dart
@@ -22,28 +22,28 @@
import "override_checking_A01_opted_in_lib.dart";
class A1 extends OPTED_NEVER_RETURN {
- int getNever() { return 1; }
+ int getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
class A2 extends OPTED_NEVER_RETURN {
- Object getNever() { return 1; }
+ Object getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
class A3 extends OPTED_NEVER_RETURN {
- dynamic getNever() { return 1; }
+ dynamic getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
class A4 extends OPTED_NEVER_RETURN {
- FutureOr getNever() { return 1; }
+ FutureOr getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t07.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t07.dart
index fcd4842..2a7292e 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t07.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t07.dart
@@ -26,10 +26,10 @@
void testme1() {}
class A implements OPTED_NONNULLABLE_RETURN {
- int getInt() { return 1; }
- Object getObject() { return 1; }
- Function getFunction() { return testme1; }
- FutureOr<int> getFutureOrInt() { return 1; }
+ int getInt() => 1;
+ Object getObject() => 1;
+ Function getFunction() => testme1;
+ FutureOr<int> getFutureOrInt() => 1;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t08.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t08.dart
index b54a047..bd53676 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t08.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t08.dart
@@ -23,10 +23,10 @@
import "override_checking_A01_opted_in_lib.dart";
class A implements OPTED_NONNULLABLE_RETURN {
- int getInt() { return null; }
- Object getObject() { return null; }
- Function getFunction() { return null; }
- FutureOr<int> getFutureOrInt() { return null; }
+ int getInt() => null;
+ Object getObject() => null;
+ Function getFunction() => null;
+ FutureOr<int> getFutureOrInt() => null;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t09.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t09.dart
index b1abe07..0065c0b 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t09.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t09.dart
@@ -25,12 +25,12 @@
void testme1() {}
class A implements OPTED_NULLABLE_RETURN {
- int getInt() { return 1; }
- Object getObject() { return 1; }
- Function getFunction() { return testme1; }
- FutureOr getFutureOr() { return 1; }
- dynamic getDynamic() { return 1; }
- Null getNull() { return null; }
+ int getInt() => 1;
+ Object getObject() => 1;
+ Function getFunction() => testme1;
+ FutureOr getFutureOr() => 1;
+ dynamic getDynamic() => 1;
+ Null getNull() => 1;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t10.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t10.dart
index 6df1fa2..5848ed0 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t10.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t10.dart
@@ -23,12 +23,12 @@
import "override_checking_A01_opted_in_lib.dart";
class A implements OPTED_NULLABLE_RETURN {
- int getInt() { return null; }
- Object getObject() { return null; }
- Function getFunction() { return null; }
- FutureOr getFutureOr() { return null; }
- dynamic getDynamic() { return null; }
- Null getNull() { return null; }
+ int getInt() => null;
+ Object getObject() => null;
+ Function getFunction() => null;
+ FutureOr getFutureOr() => null;
+ dynamic getDynamic() => null;
+ Null getNull() => null;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t11.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t11.dart
index e8e45d4..94b00a2 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t11.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t11.dart
@@ -24,7 +24,7 @@
import "override_checking_A01_opted_in_lib.dart";
class A implements OPTED_NEVER_RETURN {
- Null getNever() { return null; }
+ Null getNever() => null;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t12.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t12.dart
index 0a2e6c4..1422f5f 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t12.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t12.dart
@@ -23,28 +23,28 @@
import "override_checking_A01_opted_in_lib.dart";
class A1 implements OPTED_NEVER_RETURN {
- int getNever() { return 1; }
+ int getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
class A2 implements OPTED_NEVER_RETURN {
- Object getNever() { return 1; }
+ Object getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
class A3 implements OPTED_NEVER_RETURN {
- dynamic getNever() { return 1; }
+ dynamic getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
class A4 implements OPTED_NEVER_RETURN {
- FutureOr getNever() { return 1; }
+ FutureOr getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t13.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t13.dart
index d38b675..070497a 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t13.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t13.dart
@@ -26,10 +26,10 @@
void testme1() {}
class A with OPTED_NONNULLABLE_RETURN {
- int getInt() { return 1; }
- Object getObject() { return 1; }
- Function getFunction() { return testme1; }
- FutureOr<int> getFutureOrInt() { return 1; }
+ int getInt() => 1;
+ Object getObject() => 1;
+ Function getFunction() => testme1;
+ FutureOr<int> getFutureOrInt() => 1;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t14.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t14.dart
index 4eb48ec..0edf527 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t14.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t14.dart
@@ -23,10 +23,10 @@
import "override_checking_A01_opted_in_lib.dart";
class A with OPTED_NONNULLABLE_RETURN {
- int getInt() { return null; }
- Object getObject() { return null; }
- Function getFunction() { return null; }
- FutureOr<int> getFutureOrInt() { return null; }
+ int getInt() => null;
+ Object getObject() => null;
+ Function getFunction() => null;
+ FutureOr<int> getFutureOrInt() => null;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t15.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t15.dart
index a398066..8ec3b96 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t15.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t15.dart
@@ -26,11 +26,11 @@
void testme1() {}
class A with OPTED_NULLABLE_RETURN {
- int getInt() { return 1; }
- Object getObject() { return 1; }
- Function getFunction() { return testme1; }
- FutureOr getFutureOr() { return 1; }
- dynamic getDynamic() { return 1; }
+ int getInt() => 1;
+ Object getObject() => 1;
+ Function getFunction() => testme1;
+ FutureOr getFutureOr() => 1;
+ dynamic getDynamic() => 1;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t16.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t16.dart
index 925ab54..bcc0fff 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t16.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t16.dart
@@ -23,12 +23,12 @@
import "override_checking_A01_opted_in_lib.dart";
class A with OPTED_NULLABLE_RETURN {
- int getInt() { return null; }
- Object getObject() { return null; }
- Function getFunction() { return null; }
- FutureOr getFutureOr() { return null; }
- dynamic getDynamic() { return null; }
- Null getNull() { return null; }
+ int getInt() => null;
+ Object getObject() => null;
+ Function getFunction() => null;
+ FutureOr getFutureOr() => null;
+ dynamic getDynamic() => null;
+ Null getNull() => null;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t17.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t17.dart
index 3d2eecf..2c7f045 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t17.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t17.dart
@@ -24,7 +24,7 @@
import "override_checking_A01_opted_in_lib.dart";
class A with OPTED_NEVER_RETURN {
- Null getNever() { return null; }
+ Null getNever() => null;
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t18.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t18.dart
index 87f11f8..97a39d6 100644
--- a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t18.dart
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t18.dart
@@ -23,28 +23,28 @@
import "override_checking_A01_opted_in_lib.dart";
class A1 with OPTED_NEVER_RETURN {
- int getNever() { return 1; }
+ int getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
class A2 extends OPTED_NEVER_RETURN {
- Object getNever() { return 1; }
+ Object getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
class A3 extends OPTED_NEVER_RETURN {
- dynamic getNever() { return 1; }
+ dynamic getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}
class A4 extends OPTED_NEVER_RETURN {
- FutureOr getNever() { return 1; }
+ FutureOr getNever() => 1;
// ^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t19.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t19.dart
new file mode 100644
index 0000000..d015015
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t19.dart
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can return non-null values if parent method
+ * return type is non-nullable.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class A extends B implements OPTED_NONNULLABLE_RETURN {}
+
+class B {
+ int getInt() => 1;
+ Object getObject() => 1;
+ Function getFunction() => testme1;
+ FutureOr<int> getFutureOrInt() => 1;
+}
+
+main() {
+ A a = A();
+
+ Expect.equals(1, a.getInt());
+ Expect.equals(1, a.getObject());
+ Expect.equals(1, a.getFutureOrInt());
+ Expect.equals(testme1, a.getFunction());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t20.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t20.dart
new file mode 100644
index 0000000..d4a7370
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t20.dart
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can return [null] if parent method returns
+ * non-nullable.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NONNULLABLE_RETURN {}
+
+class B {
+ int getInt() => null;
+ Object getObject() => null;
+ Function getFunction() => null;
+ FutureOr<int> getFutureOrInt() => null;
+}
+
+main() {
+ A a = A();
+
+ Expect.isNull(a.getInt());
+ Expect.isNull(a.getObject());
+ Expect.isNull(a.getFutureOrInt());
+ Expect.isNull(a.getFunction());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t21.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t21.dart
new file mode 100644
index 0000000..200d92e
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t21.dart
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can return non-null values if parent method
+ * return type is nullable.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class A extends B implements OPTED_NULLABLE_RETURN {}
+
+class B {
+ int getInt() => 1;
+ Object getObject() => 1;
+ Function getFunction() => testme1;
+ FutureOr getFutureOr() => 1;
+ dynamic getDynamic() => 1;
+ Null getNull() => null;
+}
+
+main() {
+ A a = A();
+
+ Expect.equals(1, a.getInt());
+ Expect.equals(1, a.getObject());
+ Expect.equals(1, a.getFutureOr());
+ Expect.equals(1, a.getDynamic());
+ Expect.equals(testme1, a.getFunction());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t22.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t22.dart
new file mode 100644
index 0000000..5f5abe4
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t22.dart
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can return [null] if parent method return type
+ * is nullable.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NULLABLE_RETURN {}
+
+class B {
+ int getInt() => null;
+ Object getObject() => null;
+ Function getFunction() => null;
+ FutureOr getFutureOr() => null;
+ dynamic getDynamic() => null;
+ Null getNull() => null;
+}
+
+main() {
+ A a = A();
+
+ Expect.isNull(a.getInt());
+ Expect.isNull(a.getObject());
+ Expect.isNull(a.getFutureOr());
+ Expect.isNull(a.getDynamic());
+ Expect.isNull(a.getFunction());
+ Expect.isNull(a.getNull());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t23.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t23.dart
new file mode 100644
index 0000000..9e7a3ca
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t23.dart
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method can return [null] if parent method return type
+ * is [Never].
+
+ * @Issue 40389
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NEVER_RETURN {}
+
+class B {
+ Null getNever() => null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.getNever());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_RETURN_t24.dart b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t24.dart
new file mode 100644
index 0000000..56fede4
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_RETURN_t24.dart
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy method cannot return anything but [null] if parent
+ * method return type is [Never].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "override_checking_A01_opted_in_lib.dart";
+
+class B1 { int getNever() => 1; }
+class A1 extends B1 implements OPTED_NEVER_RETURN {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B2 { Object getNever() => 1; }
+class A2 extends B2 implements OPTED_NEVER_RETURN {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B3 { dynamic getNever() => 1; }
+class A3 extends B3 implements OPTED_NEVER_RETURN {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class B4 { FutureOr getNever() => 1; }
+class A4 extends B4 implements OPTED_NEVER_RETURN {
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ A1();
+ A2();
+ A3();
+ A4();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_SETTER_t19.dart b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t19.dart
new file mode 100644
index 0000000..d3c13ba
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t19.dart
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy setter can accept non-null values if corresponding
+ * parent setter is of non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class A extends B implements OPTED_NONNULLABLE_SETTER {}
+
+class B {
+ void set setInt (int i) { Expect.equals(1, i); }
+ void set setObject (Object o) { Expect.equals(1, o); }
+ void set setFunction (Function f) { Expect.equals(testme1, f); }
+ void set setFutureOrInt(FutureOr<int> i) { Expect.equals(1, i); }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = 1;
+ a.setObject = 1;
+ a.setFutureOrInt = 1;
+ a.setFunction = testme1;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_SETTER_t20.dart b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t20.dart
new file mode 100644
index 0000000..cb18861
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t20.dart
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2019, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy setter can accept [null] values if corresponding
+ * parent setter is of non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NONNULLABLE_SETTER {}
+
+class B {
+ void set setInt (int i) { Expect.isNull(i); }
+ void set setObject (Object o) { Expect.isNull(o); }
+ void set setFunction (Function f) { Expect.isNull(f); }
+ void set setFutureOrInt(FutureOr<int> i) { Expect.isNull(i); }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = null;
+ a.setObject = null;
+ a.setFutureOrInt = null;
+ a.setFunction = null;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_SETTER_t21.dart b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t21.dart
new file mode 100644
index 0000000..6f102cd
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t21.dart
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy setter can accept non-null values if corresponding
+ * parent setter is of nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class A extends B implements OPTED_NULLABLE_SETTER {}
+
+class B {
+ void set setInt (int i) { Expect.equals(1, i); }
+ void set setObject (Object o) { Expect.equals(1, o); }
+ void set setFunction(Function f) { Expect.equals(testme1, f); }
+ void set setFutureOr(FutureOr i) { Expect.equals(1, i); }
+ void set setDynamic (dynamic d) { Expect.equals(1, d); }
+ void set setNull (Null n) {}
+}
+
+main() {
+ A a = A();
+
+ a.setInt = 1;
+ a.setObject = 1;
+ a.setFutureOr = 1;
+ a.setFunction = testme1;
+ a.setDynamic = 1;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_SETTER_t22.dart b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t22.dart
new file mode 100644
index 0000000..78dab99
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t22.dart
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy setter can accept [null] values if corresponding
+ * parent setter is of nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NULLABLE_SETTER {}
+
+class B {
+ void set setInt (int i) { Expect.isNull(i); }
+ void set setObject (Object o) { Expect.isNull(o); }
+ void set setFunction(Function f) { Expect.isNull(f); }
+ void set setFutureOr(FutureOr i) { Expect.isNull(i); }
+ void set setDynamic (dynamic d) { Expect.isNull(d); }
+ void set setNull (Null n) { Expect.isNull(n); }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = null;
+ a.setObject = null;
+ a.setFutureOr = null;
+ a.setFunction = null;
+ a.setDynamic = null;
+ a.setNull = null;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_SETTER_t23.dart b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t23.dart
new file mode 100644
index 0000000..a98fd87
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t23.dart
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy setter can accept [null] if corresponding parent
+ * setter is of the [Never] type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+class A extends B implements OPTED_NEVER_SETTER {}
+
+class B {
+ void set setNever(Null i) { Expect.isNull(i); }
+}
+
+main() {
+ A a = A();
+ a.setNever = null;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A01_SETTER_t24.dart b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t24.dart
new file mode 100644
index 0000000..2fc4f63
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A01_SETTER_t24.dart
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2020, 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.
+ */
+/**
+ * @assertion In an unmigrated library, override checking is done using legacy
+ * types. This means that an unmigrated library can bring together otherwise
+ * incompatible methods. When choosing the most specific signature during
+ * interface computation, all nullability and requiredness annotations are
+ * ignored, and the [Never] type is treated as [Null].
+ *
+ * @description Check that if legacy class extends legacy class and implements
+ * opted-in class, legacy setter can accept non-null values if corresponding
+ * parent setter is of the [Never] type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+// @dart=2.6
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_A01_opted_in_lib.dart";
+
+void testme1() {}
+
+class A1 extends B1 implements OPTED_NEVER_SETTER {}
+class B1 {
+ void set setNever(int i) { Expect.equals(1, i); }
+}
+
+class A2 extends B2 implements OPTED_NEVER_SETTER {}
+class B2 {
+ void set setNever(dynamic d) { Expect.equals(1, d); }
+}
+
+class A3 extends B3 implements OPTED_NEVER_SETTER {}
+class B3 {
+ void set setNever(Object o) { Expect.equals(1, o); }
+}
+
+class A4 extends B4 implements OPTED_NEVER_SETTER {}
+class B4 {
+ void set setNever(FutureOr f) { Expect.equals(1, f); }
+}
+
+class A5 extends B5 implements OPTED_NEVER_SETTER {}
+class B5 {
+ void set setNever(Function f) { Expect.equals(testme1, f); }
+}
+
+main() {
+ A1().setNever = 1;
+ A2().setNever = 1;
+ A3().setNever = 1;
+ A4().setNever = 1;
+ A5().setNever = testme1;
+}