Fixed Issue #465: tests for overriding with NNBD re-named and corrected. New tests added.
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t01.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t01.dart
new file mode 100644
index 0000000..aeea4e6
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t01.dart
@@ -0,0 +1,54 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class extends generic legacy
+ * class, child opted-in class type parameter can extend nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class Opted<T> extends LEGACY_CLASS<T> {
+  dynamic getParamType() => typeOf<T>();
+}
+
+class OptedInt<T extends int?> extends LEGACY_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Object?> extends LEGACY_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Function?> extends LEGACY_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedNull<T extends Null> extends LEGACY_CLASS_NULL<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(dynamic, Opted().getParamType());
+  Expect.equals(dynamic, Opted<dynamic>().getParamType());
+
+  Expect.equals(typeOf<int?>(), OptedInt().getParamType());
+  Expect.equals(typeOf<int?>(), OptedInt<int?>().getParamType());
+
+  Expect.equals(typeOf<Object?>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Object?>(), OptedObject<Object?>().getParamType());
+
+  Expect.equals(typeOf<Function?>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Function?>(), OptedFunction<Function?>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t02.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t02.dart
new file mode 100644
index 0000000..8e50e34
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t02.dart
@@ -0,0 +1,57 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class extends generic legacy
+ * class with [FutureOr<nullable_type>] type parameter, child opted-in class
+ * type parameter can extend nullable type.
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OptedFutureOr<T extends FutureOr> extends LEGACY_CLASS_FUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrInt<T extends FutureOr<int>?> extends LEGACY_CLASS_FUTUREORINT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends FutureOr<Function>?> extends LEGACY_CLASS_FUTUREORFUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFutureOr<T extends FutureOr<FutureOr>?> extends LEGACY_CLASS_FUTUREORFUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr().getParamType());
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr<FutureOr>().getParamType());
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr<FutureOr?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<int>?>(), OptedFutureOrInt().getParamType());
+  Expect.equals(typeOf<FutureOr<int>?>(), OptedFutureOrInt<FutureOr<int>?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<Function>?>(), OptedFutureOrFunction().getParamType());
+  Expect.equals(typeOf<FutureOr<Function>?>(), OptedFutureOr<FutureOr<Function>?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr().getParamType());
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr<FutureOr<FutureOr>>().getParamType());
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr<FutureOr<FutureOr>?>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t03.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t03.dart
new file mode 100644
index 0000000..31c4e39
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t03.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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class extends generic legacy
+ * class, child opted-in class type parameter can extend non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class OptedInt<T extends int> extends LEGACY_CLASS_INT<T> {
+ dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Object> extends LEGACY_CLASS_OBJECT<T> {
+ dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Function> extends LEGACY_CLASS_FUNCTION<T> {
+ dynamic getParamType() => T;
+}
+
+main() {
+ Expect.equals(typeOf<int>(), OptedInt().getParamType());
+ Expect.equals(typeOf<int>(), OptedInt<int>().getParamType());
+
+ Expect.equals(typeOf<Object>(), OptedObject().getParamType());
+ Expect.equals(typeOf<Object>(), OptedObject<Object>().getParamType());
+
+ Expect.equals(typeOf<Function>(), OptedFunction().getParamType());
+ Expect.equals(typeOf<Function>(), OptedFunction<Function>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t04.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t04.dart
new file mode 100644
index 0000000..8d4dcc3
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t04.dart
@@ -0,0 +1,40 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class extends generic legacy
+ * class with [FutureOr<non_nullable_type>] type parameter, child opted-in class
+ * type parameter can extend non-nullable [FutureOr<non_nullable_type>] type.
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OptedFutureOrInt<T extends FutureOr<int>> extends LEGACY_CLASS_FUTUREORINT<T> {
+ dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends FutureOr<Function>> extends LEGACY_CLASS_FUTUREORFUNCTION<T> {
+ dynamic getParamType() => T;
+}
+
+main() {
+ Expect.equals(typeOf<FutureOr<int>>(), OptedFutureOrInt().getParamType());
+ Expect.equals(typeOf<FutureOr<int>>(), OptedFutureOrInt<FutureOr<int>>().getParamType());
+
+ Expect.equals(typeOf<FutureOr<Function>>(), OptedFutureOrFunction().getParamType());
+ Expect.equals(typeOf<FutureOr<Function>>(), OptedFutureOrFunction<FutureOr<Function>>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t05.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t05.dart
new file mode 100644
index 0000000..188daf8
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t05.dart
@@ -0,0 +1,54 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class extends generic legacy
+ * class, child opted-in class type parameter can extend [Null].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class Opted<T extends Null> extends LEGACY_CLASS<T> {
+  dynamic getParamType() => typeOf<T>();
+}
+
+class OptedInt<T extends Null> extends LEGACY_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Null> extends LEGACY_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Null> extends LEGACY_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedNull<T extends Null> extends LEGACY_CLASS_NULL<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<Null>(), Opted().getParamType());
+  Expect.equals(typeOf<Null>(), Opted<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedInt().getParamType());
+  Expect.equals(typeOf<Null>(), OptedInt<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Null>(), OptedObject<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFunction<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t06.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t06.dart
new file mode 100644
index 0000000..887c644
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t06.dart
@@ -0,0 +1,54 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class extends generic legacy
+ * class with [FutureOr] type parameter, child opted-in class type parameter can
+ * extend [Null].
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OptedFutureOr<T extends Null> extends LEGACY_CLASS_FUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrInt<T extends Null> extends LEGACY_CLASS_FUTUREORINT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends Null> extends LEGACY_CLASS_FUTUREORFUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFutureOr<T extends Null> extends LEGACY_CLASS_FUTUREORFUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<Null>(), OptedFutureOr().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOr<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrInt().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrInt<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrFunction().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrFunction<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrFutureOr().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrFutureOr<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t07.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t07.dart
new file mode 100644
index 0000000..a8999dc
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t07.dart
@@ -0,0 +1,54 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements generic legacy
+ * class, child opted-in class type parameter can extend nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class Opted<T> implements LEGACY_CLASS<T> {
+  dynamic getParamType() => typeOf<T>();
+}
+
+class OptedInt<T extends int?> implements LEGACY_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Object?> implements LEGACY_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Function?> implements LEGACY_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedNull<T extends Null> implements LEGACY_CLASS_NULL<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<dynamic>(), Opted().getParamType());
+  Expect.equals(typeOf<dynamic>(), Opted<dynamic>().getParamType());
+
+  Expect.equals(typeOf<int?>(), OptedInt().getParamType());
+  Expect.equals(typeOf<int?>(), OptedInt<int?>().getParamType());
+
+  Expect.equals(typeOf<Object?>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Object?>(), OptedObject<Object?>().getParamType());
+
+  Expect.equals(typeOf<Function?>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Function?>(), OptedFunction<Function?>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t08.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t08.dart
new file mode 100644
index 0000000..f8d33e8
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t08.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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements generic legacy
+ * class with [FutureOr<nullable_type>] type parameter, child opted-in class
+ * type parameter can extend nullable type.
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OptedFutureOr<T extends FutureOr> implements LEGACY_CLASS_FUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrInt<T extends FutureOr<int>?> implements LEGACY_CLASS_FUTUREORINT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends FutureOr<Function>?> implements LEGACY_CLASS_FUTUREORFUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFutureOr<T extends FutureOr<FutureOr>?> implements LEGACY_CLASS_FUTUREORFUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr().getParamType());
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr<FutureOr>().getParamType());
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr<FutureOr?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<int>?>(), OptedFutureOrInt().getParamType());
+  Expect.equals(typeOf<FutureOr<int>?>(), OptedFutureOrInt<FutureOr<int>?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<Function>?>(), OptedFutureOrFunction().getParamType());
+  Expect.equals(typeOf<FutureOr<Function>?>(), OptedFutureOrFunction<FutureOr<Function>?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr().getParamType());
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr<FutureOr<FutureOr>>().getParamType());
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr<FutureOr<FutureOr>?>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t09.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t09.dart
new file mode 100644
index 0000000..4a6a6b9
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t09.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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements generic legacy
+ * class, child opted-in class type parameter can extend non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class OptedInt<T extends int> implements LEGACY_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Object> implements LEGACY_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Function> implements LEGACY_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<int>(), OptedInt().getParamType());
+  Expect.equals(typeOf<int>(), OptedInt<int>().getParamType());
+
+  Expect.equals(typeOf<Object>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Object>(), OptedObject<Object>().getParamType());
+
+  Expect.equals(typeOf<Function>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Function>(), OptedFunction<Function>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t10.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t10.dart
new file mode 100644
index 0000000..56c6f78
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t10.dart
@@ -0,0 +1,40 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements generic legacy
+ * class with [FutureOr<non_nullable_type>] type parameter, child opted-in class
+ * type parameter can extend non-nullable [FutureOr<non_nullable_type>] type.
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OptedFutureOrInt<T extends FutureOr<int>> implements LEGACY_CLASS_FUTUREORINT<T> {
+ dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends FutureOr<Function>> implements LEGACY_CLASS_FUTUREORFUNCTION<T> {
+ dynamic getParamType() => T;
+}
+
+main() {
+ Expect.equals(typeOf<FutureOr<int>>(), OptedFutureOrInt().getParamType());
+ Expect.equals(typeOf<FutureOr<int>>(), OptedFutureOrInt<FutureOr<int>>().getParamType());
+
+ Expect.equals(typeOf<FutureOr<Function>>(), OptedFutureOrFunction().getParamType());
+ Expect.equals(typeOf<FutureOr<Function>>(), OptedFutureOrFunction<FutureOr<Function>>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t11.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t11.dart
new file mode 100644
index 0000000..7e59a4b
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t11.dart
@@ -0,0 +1,54 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements generic legacy
+ * class, child opted-in class type parameter can extend [Null].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class Opted<T extends Null> implements LEGACY_CLASS<T> {
+  dynamic getParamType() => typeOf<T>();
+}
+
+class OptedInt<T extends Null> implements LEGACY_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Null> implements LEGACY_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Null> implements LEGACY_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedNull<T extends Null> implements LEGACY_CLASS_NULL<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<Null>(), Opted().getParamType());
+  Expect.equals(typeOf<Null>(), Opted<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedInt().getParamType());
+  Expect.equals(typeOf<Null>(), OptedInt<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Null>(), OptedObject<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFunction<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t12.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t12.dart
new file mode 100644
index 0000000..0355f0f
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t12.dart
@@ -0,0 +1,54 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements generic legacy
+ * class with [FutureOr] type parameter, child opted-in class type parameter can
+ * extend [Null].
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OptedFutureOr<T extends Null> implements LEGACY_CLASS_FUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrInt<T extends Null> implements LEGACY_CLASS_FUTUREORINT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends Null> implements LEGACY_CLASS_FUTUREORFUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFutureOr<T extends Null> implements LEGACY_CLASS_FUTUREORFUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<Null>(), OptedFutureOr().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOr<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrInt().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrInt<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrFunction().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrFunction<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrFutureOr().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrFutureOr<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t13.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t13.dart
new file mode 100644
index 0000000..ac2df7d
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t13.dart
@@ -0,0 +1,54 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class is a mixin with generic
+ * legacy class, child opted-in class type parameter can extend nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class Opted<T> with LEGACY_CLASS<T> {
+  dynamic getParamType() => typeOf<T>();
+}
+
+class OptedInt<T extends int?> with LEGACY_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Object?> with LEGACY_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Function?> with LEGACY_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedNull<T extends Null> with LEGACY_CLASS_NULL<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(dynamic, Opted().getParamType());
+  Expect.equals(dynamic, Opted<dynamic>().getParamType());
+
+  Expect.equals(typeOf<int?>(), OptedInt().getParamType());
+  Expect.equals(typeOf<int?>(), OptedInt<int?>().getParamType());
+
+  Expect.equals(typeOf<Object?>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Object?>(), OptedObject<Object?>().getParamType());
+
+  Expect.equals(typeOf<Function?>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Function?>(), OptedFunction<Function?>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t14.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t14.dart
new file mode 100644
index 0000000..5ba88fb
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t14.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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class is a mixin  generic legacy
+ * class with [FutureOr<nullable_type>] type parameter, child opted-in class
+ * type parameter can extend nullable type.
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OptedFutureOr<T extends FutureOr> with LEGACY_CLASS_FUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrInt<T extends FutureOr<int>?> with LEGACY_CLASS_FUTUREORINT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends FutureOr<Function>?> with LEGACY_CLASS_FUTUREORFUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFutureOr<T extends FutureOr<FutureOr>?> with LEGACY_CLASS_FUTUREORFUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr().getParamType());
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr<FutureOr>().getParamType());
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr<FutureOr?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<int>?>(), OptedFutureOrInt().getParamType());
+  Expect.equals(typeOf<FutureOr<int>?>(), OptedFutureOrInt<FutureOr<int>?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<Function>?>(), OptedFutureOrFunction().getParamType());
+  Expect.equals(typeOf<FutureOr<Function>?>(), OptedFutureOrFunction<FutureOr<Function>?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr().getParamType());
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr<FutureOr<FutureOr>>().getParamType());
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr<FutureOr<FutureOr>?>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t15.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t15.dart
new file mode 100644
index 0000000..d8bf8a1
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t15.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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class is a mixin with generic
+ * legacy class, child opted-in class type parameter can extend non-nullable
+ * type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class OptedInt<T extends int> with LEGACY_CLASS_INT<T> {
+ dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Object> with LEGACY_CLASS_OBJECT<T> {
+ dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Function> with LEGACY_CLASS_FUNCTION<T> {
+ dynamic getParamType() => T;
+}
+
+main() {
+ Expect.equals(typeOf<int>(), OptedInt().getParamType());
+ Expect.equals(typeOf<int>(), OptedInt<int>().getParamType());
+
+ Expect.equals(typeOf<Object>(), OptedObject().getParamType());
+ Expect.equals(typeOf<Object>(), OptedObject<Object>().getParamType());
+
+ Expect.equals(typeOf<Function>(), OptedFunction().getParamType());
+ Expect.equals(typeOf<Function>(), OptedFunction<Function>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t16.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t16.dart
new file mode 100644
index 0000000..97d1187
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t16.dart
@@ -0,0 +1,41 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class is a mixin with generic
+ * legacy class with [FutureOr<non_nullable_type>] type parameter, child
+ * opted-in class type parameter can extend non-nullable
+ * [FutureOr<non_nullable_type>] type.
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OptedFutureOrInt<T extends FutureOr<int>> with LEGACY_CLASS_FUTUREORINT<T> {
+ dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends FutureOr<Function>> with LEGACY_CLASS_FUTUREORFUNCTION<T> {
+ dynamic getParamType() => T;
+}
+
+main() {
+ Expect.equals(typeOf<FutureOr<int>>(), OptedFutureOrInt().getParamType());
+ Expect.equals(typeOf<FutureOr<int>>(), OptedFutureOrInt<FutureOr<int>>().getParamType());
+
+ Expect.equals(typeOf<FutureOr<Function>>(), OptedFutureOrFunction().getParamType());
+ Expect.equals(typeOf<FutureOr<Function>>(), OptedFutureOrFunction<FutureOr<Function>>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t17.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t17.dart
new file mode 100644
index 0000000..40935e0
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t17.dart
@@ -0,0 +1,54 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class is a mixin with generic
+ * legacy class, child opted-in class type parameter can extend [Null].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class Opted<T extends Null> with LEGACY_CLASS<T> {
+  dynamic getParamType() => typeOf<T>();
+}
+
+class OptedInt<T extends Null> with LEGACY_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Null> with LEGACY_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Null> with LEGACY_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedNull<T extends Null> with LEGACY_CLASS_NULL<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<Null>(), Opted().getParamType());
+  Expect.equals(typeOf<Null>(), Opted<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedInt().getParamType());
+  Expect.equals(typeOf<Null>(), OptedInt<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Null>(), OptedObject<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFunction<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t18.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t18.dart
new file mode 100644
index 0000000..811cda2
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t18.dart
@@ -0,0 +1,54 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class is a mixin with generic
+ * legacy class with [FutureOr] type parameter, child opted-in class type
+ * parameter can extend [Null].
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OptedFutureOr<T extends Null> extends LEGACY_CLASS_FUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrInt<T extends Null> extends LEGACY_CLASS_FUTUREORINT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends Null> extends LEGACY_CLASS_FUTUREORFUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFutureOr<T extends Null> extends LEGACY_CLASS_FUTUREORFUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<Null>(), OptedFutureOr().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOr<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrInt().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrInt<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrFunction().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrFunction<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrFutureOr().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrFutureOr<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t19.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t19.dart
new file mode 100644
index 0000000..a3d8618
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t19.dart
@@ -0,0 +1,60 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements two classes (one
+ * is legacy), child opted-in class type parameter can extend nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class OPTED_CLASS<T>                                             {}
+class OPTED_CLASS_INT<T extends int?>                            {}
+class OPTED_CLASS_OBJECT<T extends Object?>                      {}
+class OPTED_CLASS_FUNCTION<T extends Function?>                  {}
+class OPTED_CLASS_NULL<T extends Null>                           {}
+
+class Opted<T> implements LEGACY_CLASS<T>, OPTED_CLASS<T> {
+  dynamic getParamType() => typeOf<T>();
+}
+
+class OptedInt<T extends int?> implements LEGACY_CLASS_INT<T>, OPTED_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Object?> implements OPTED_CLASS_OBJECT<T>, LEGACY_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Function?> implements LEGACY_CLASS_FUNCTION<T>, OPTED_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedNull<T extends Null> implements LEGACY_CLASS_NULL<T>, OPTED_CLASS_NULL<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<dynamic>(), Opted().getParamType());
+  Expect.equals(typeOf<dynamic>(), Opted<dynamic>().getParamType());
+
+  Expect.equals(typeOf<int?>(), OptedInt().getParamType());
+  Expect.equals(typeOf<int?>(), OptedInt<int?>().getParamType());
+
+  Expect.equals(typeOf<Object?>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Object?>(), OptedObject<Object?>().getParamType());
+
+  Expect.equals(typeOf<Function?>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Function?>(), OptedFunction<Function?>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t20.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t20.dart
new file mode 100644
index 0000000..cc8d964
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t20.dart
@@ -0,0 +1,61 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements two classes (one
+ * is legacy) class with [FutureOr<nullable_type>] type parameter, child
+ * opted-in class type parameter can extend nullable type.
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OPTED_CLASS_FUTUREOR<T extends FutureOr>                    {}
+class OPTED_CLASS_FUTUREORINT<T extends FutureOr<int>?>           {}
+class OPTED_CLASS_FUTUREORFUNCTION<T extends FutureOr<Function>?> {}
+class OPTED_CLASS_FUTUREORFUTUREOR<T extends FutureOr<FutureOr>>  {}
+
+class OptedFutureOr<T extends FutureOr> implements LEGACY_CLASS_FUTUREOR<T>, OPTED_CLASS_FUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrInt<T extends FutureOr<int>?> implements LEGACY_CLASS_FUTUREORINT<T>, OPTED_CLASS_FUTUREORINT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends FutureOr<Function>?> implements LEGACY_CLASS_FUTUREORFUNCTION<T>, OPTED_CLASS_FUTUREORFUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFutureOr<T extends FutureOr<FutureOr>?> implements LEGACY_CLASS_FUTUREORFUTUREOR<T>, OPTED_CLASS_FUTUREORFUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr().getParamType());
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr<FutureOr>().getParamType());
+  Expect.equals(typeOf<FutureOr<dynamic>>(), OptedFutureOr<FutureOr?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<int>?>(), OptedFutureOrInt().getParamType());
+  Expect.equals(typeOf<FutureOr<int>?>(), OptedFutureOrInt<FutureOr<int>?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<Function>?>(), OptedFutureOrFunction().getParamType());
+  Expect.equals(typeOf<FutureOr<Function>?>(), OptedFutureOrFunction<FutureOr<Function>?>().getParamType());
+
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr().getParamType());
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr<FutureOr<FutureOr>>().getParamType());
+  Expect.equals(typeOf<FutureOr<FutureOr>>(), OptedFutureOrFutureOr<FutureOr<FutureOr>?>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t21.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t21.dart
new file mode 100644
index 0000000..9a07cc2
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t21.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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements two classes (one
+ * is legacy), child opted-in class type parameter can extend non-nullable type.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class OPTED_CLASS_INT<T extends int>                             {}
+class OPTED_CLASS_OBJECT<T extends Object>                       {}
+class OPTED_CLASS_FUNCTION<T extends Function>                   {}
+
+class OptedInt<T extends int> implements LEGACY_CLASS_INT<T>, OPTED_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Object> implements LEGACY_CLASS_OBJECT<T>, OPTED_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Function> implements LEGACY_CLASS_FUNCTION<T>, OPTED_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<int>(), OptedInt().getParamType());
+  Expect.equals(typeOf<int>(), OptedInt<int>().getParamType());
+
+  Expect.equals(typeOf<Object>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Object>(), OptedObject<Object>().getParamType());
+
+  Expect.equals(typeOf<Function>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Function>(), OptedFunction<Function>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t22.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t22.dart
new file mode 100644
index 0000000..8f6ef28
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t22.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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements two classes (one
+ * is legacy) with [FutureOr<non_nullable_type>] type parameter, child opted-in
+ * class type parameter can extend non-nullable [FutureOr<non_nullable_type>]
+ * type.
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OPTED_CLASS_FUTUREORINT<T extends FutureOr<int>>           {}
+class OPTED_CLASS_FUTUREORFUNCTION<T extends FutureOr<Function>> {}
+
+class OptedFutureOrInt<T extends FutureOr<int>> implements LEGACY_CLASS_FUTUREORINT<T>, OPTED_CLASS_FUTUREORINT<T> {
+ dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends FutureOr<Function>> implements LEGACY_CLASS_FUTUREORFUNCTION<T>, OPTED_CLASS_FUTUREORFUNCTION<T> {
+ dynamic getParamType() => T;
+}
+
+main() {
+ Expect.equals(typeOf<FutureOr<int>>(), OptedFutureOrInt().getParamType());
+ Expect.equals(typeOf<FutureOr<int>>(), OptedFutureOrInt<FutureOr<int>>().getParamType());
+
+ Expect.equals(typeOf<FutureOr<Function>>(), OptedFutureOrFunction().getParamType());
+ Expect.equals(typeOf<FutureOr<Function>>(), OptedFutureOrFunction<FutureOr<Function>>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t23.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t23.dart
new file mode 100644
index 0000000..627cbda
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t23.dart
@@ -0,0 +1,60 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements two classes (one
+ * is legacy), child opted-in class type parameter can extend [Null].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class OPTED_CLASS<T>                                             {}
+class OPTED_CLASS_INT<T extends int?>                            {}
+class OPTED_CLASS_OBJECT<T extends Object?>                      {}
+class OPTED_CLASS_FUNCTION<T extends Function?>                  {}
+class OPTED_CLASS_NULL<T extends Null>                           {}
+
+class Opted<T extends Null> implements LEGACY_CLASS<T>, OPTED_CLASS<T> {
+  dynamic getParamType() => typeOf<T>();
+}
+
+class OptedInt<T extends Null> implements LEGACY_CLASS_INT<T>, OPTED_CLASS_INT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedObject<T extends Null> implements LEGACY_CLASS_OBJECT<T>, OPTED_CLASS_OBJECT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFunction<T extends Null> implements LEGACY_CLASS_FUNCTION<T>, OPTED_CLASS_FUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedNull<T extends Null> implements LEGACY_CLASS_NULL<T>, OPTED_CLASS_NULL<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<Null>(), Opted().getParamType());
+  Expect.equals(typeOf<Null>(), Opted<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedInt().getParamType());
+  Expect.equals(typeOf<Null>(), OptedInt<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedObject().getParamType());
+  Expect.equals(typeOf<Null>(), OptedObject<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFunction().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFunction<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t24.dart b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t24.dart
new file mode 100644
index 0000000..ceb662a
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_CLASSPARAM_t24.dart
@@ -0,0 +1,59 @@
+/*
+ * 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 a migrated library, override checking must check that an
+ * override is consistent with all overridden methods from other migrated
+ * libraries in the super-interface chain, since a legacy library is permitted
+ * to override otherwise incompatible signatures for a method.
+ *
+ * @description Check that if generic opted-in class implements two classes (one
+ * is legacy) with [FutureOr] type parameter, child opted-in class type
+ * parameter can extend [Null].
+ *
+ * @Issue 39666
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_futureor_lib.dart";
+
+class OPTED_CLASS_FUTUREOR<T extends FutureOr?>                   {}
+class OPTED_CLASS_FUTUREORINT<T extends FutureOr<int>?>           {}
+class OPTED_CLASS_FUTUREORFUNCTION<T extends FutureOr<Function>?> {}
+class OPTED_CLASS_FUTUREORFUTUREOR<T extends FutureOr<FutureOr>> {}
+
+class OptedFutureOr<T extends Null> implements LEGACY_CLASS_FUTUREOR<T>, OPTED_CLASS_FUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrInt<T extends Null> implements LEGACY_CLASS_FUTUREORINT<T>, OPTED_CLASS_FUTUREORINT<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFunction<T extends Null> implements LEGACY_CLASS_FUTUREORFUNCTION<T>, OPTED_CLASS_FUTUREORFUNCTION<T> {
+  dynamic getParamType() => T;
+}
+
+class OptedFutureOrFutureOr<T extends Null> implements LEGACY_CLASS_FUTUREORFUTUREOR<T>, OPTED_CLASS_FUTUREORFUTUREOR<T> {
+  dynamic getParamType() => T;
+}
+
+main() {
+  Expect.equals(typeOf<Null>(), OptedFutureOr().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOr<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrInt().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrInt<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrFunction().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrFunction<Null>().getParamType());
+
+  Expect.equals(typeOf<Null>(), OptedFutureOrFutureOr().getParamType());
+  Expect.equals(typeOf<Null>(), OptedFutureOrFutureOr<Null>().getParamType());
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t14.dart b/LanguageFeatures/nnbd/override_checking_A02_t14.dart
deleted file mode 100644
index d931acd..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t14.dart
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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 a migrated library, override checking must check that an
- * override is consistent with all overridden methods from other migrated
- * libraries in the super-interface chain, since a legacy library is permitted
- * to override otherwise incompatible signatures for a method.
- *
- * @description Check that if opted-in class extends legacy class, child
- * opted-in class type parameter cam be nullable.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class D1<X extends A?> extends D<X> {
-  dynamic getParamType() => X;
-}
-
-class D2<X extends A> extends D<X> {
-  dynamic getParamType() => X;
-}
-
-main() {
-  D1<A> d1 = D1<A>();
-  Expect.equals(A, d1.getParamType());
-
-  D1<Null> d2 = D1<Null>();
-  Expect.equals(Null, d2.getParamType());
-
-  D1 d3 = D1();
-  Expect.equals(A, d3.getParamType());
-
-  D1<A> d4 = D1<A>();
-  Expect.equals(A, d4.getParamType());
-
-  D2<A> d5 = D2<A>();
-  Expect.equals(A, d5.getParamType());
-
-  D2 d6 = D2();
-  Expect.equals(A, d6.getParamType());
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t15.dart b/LanguageFeatures/nnbd/override_checking_A02_t15.dart
deleted file mode 100644
index 3af4af9..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t15.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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 a migrated library, override checking must check that an
- * override is consistent with all overridden methods from other migrated
- * libraries in the super-interface chain, since a legacy library is permitted
- * to override otherwise incompatible signatures for a method.
- *
- * @description Check that if opted-in class extends legacy class and child type
- * parameter is non-nullable, child opted-in class type parameter can not be
- * [Null].
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-
-class D1<X extends A> extends D<X> {}
-
-main() {
- D1<Null>();
-//  ^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t31.dart b/LanguageFeatures/nnbd/override_checking_A02_t31.dart
deleted file mode 100644
index 98a9e39..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t31.dart
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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 a migrated library, override checking must check that an
- * override is consistent with all overridden methods from other migrated
- * libraries in the super-interface chain, since a legacy library is permitted
- * to override otherwise incompatible signatures for a method.
- *
- * @description Check that if opted-in class implements legacy class, child
- * opted-in class type parameter cam be nullable.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class D1<X extends A?> implements D<X> {
-  dynamic getParamType() => X;
-}
-
-class D2<X extends A> implements D<X> {
-  dynamic getParamType() => X;
-}
-
-main() {
-  D1<A?> d1 = D1<A?>();
-  Expect.equals(A, d1.getParamType());
-
-  D1<Null> d2 = D1<Null>();
-  Expect.equals(Null, d2.getParamType());
-
-  D1 d3 = D1();
-  Expect.equals(A, d3.getParamType());
-
-  D1<A> d4 = D1<A>();
-  Expect.equals(A, d4.getParamType());
-
-  D2<A> d5 = D2<A>();
-  Expect.equals(A, d5.getParamType());
-
-  D2 d6 = D2();
-  Expect.equals(A, d6.getParamType());
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t32.dart b/LanguageFeatures/nnbd/override_checking_A02_t32.dart
deleted file mode 100644
index 036a0cd..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t32.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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 a migrated library, override checking must check that an
- * override is consistent with all overridden methods from other migrated
- * libraries in the super-interface chain, since a legacy library is permitted
- * to override otherwise incompatible signatures for a method.
- *
- * @description Check that if opted-in class implements legacy class and child
- * type parameter is non-nullable, child opted-in class type parameter cannot be
- * [Null].
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-
-class D1<X extends A> implements D<X> {}
-
-main() {
-  D1<Null>();
-//   ^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t48.dart b/LanguageFeatures/nnbd/override_checking_A02_t48.dart
deleted file mode 100644
index e9378bd..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t48.dart
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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 a migrated library, override checking must check that an
- * override is consistent with all overridden methods from other migrated
- * libraries in the super-interface chain, since a legacy library is permitted
- * to override otherwise incompatible signatures for a method.
- *
- * @description Check that if opted-in class is a mixin with legacy class, child
- * opted-in class type parameter cam be nullable.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class D1<X extends A?> with D<X> {
-  dynamic getParamType() => X;
-}
-
-class D2<X extends A> with D<X> {
-  dynamic getParamType() => X;
-}
-
-main() {
-  D1<A?> d1 = D1<A?>();
-  Expect.equals(A, d1.getParamType());
-
-  D1<Null> d2 = D1<Null>();
-  Expect.equals(Null, d2.getParamType());
-
-  D1 d3 = D1();
-  Expect.equals(A, d3.getParamType());
-
-  D1<A> d4 = D1<A>();
-  Expect.equals(A, d4.getParamType());
-
-  D2<A> d5 = D2<A>();
-  Expect.equals(A, d5.getParamType());
-
-  D2 d6 = D2();
-  Expect.equals(A, d6.getParamType());
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t49.dart b/LanguageFeatures/nnbd/override_checking_A02_t49.dart
deleted file mode 100644
index 5ea573e..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t49.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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 a migrated library, override checking must check that an
- * override is consistent with all overridden methods from other migrated
- * libraries in the super-interface chain, since a legacy library is permitted
- * to override otherwise incompatible signatures for a method.
- *
- * @description Check that if opted-in class is a mixin with legacy class and
- * child type parameter is non-nullable, child opted-in class type parameter
- * cannot be [Null].
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-
-class D1<X extends A> with D<X> {}
-
-main() {
-  D1<Null>();
-//   ^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t65.dart b/LanguageFeatures/nnbd/override_checking_A02_t65.dart
deleted file mode 100644
index be18b1c..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t65.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 a migrated library, override checking must check that an
- * override is consistent with all overridden methods from other migrated
- * libraries in the super-interface chain, since a legacy library is permitted
- * to override otherwise incompatible signatures for a method.
- *
- * @description Check that if opted-in class implements two classes (one is
- * legacy), child opted-in class type parameter cam be nullable.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-abstract class DD<X extends A?> {}
-
-class D1<X extends A?> implements D<X>, DD<X> {
-  dynamic getParamType() => X;
-}
-
-main() {
-  D1<A?> d1 = D1<A?>();
-  Expect.equals(A, d1.getParamType());
-
-  D1<Null> d2 = D1<Null>();
-  Expect.equals(Null, d2.getParamType());
-
-  D1 d3 = D1();
-  Expect.equals(A, d3.getParamType());
-
-  D1<A> d4 = D1<A>();
-  Expect.equals(A, d4.getParamType());
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t66.dart b/LanguageFeatures/nnbd/override_checking_A02_t66.dart
deleted file mode 100644
index 7b7ff55..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t66.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 a migrated library, override checking must check that an
- * override is consistent with all overridden methods from other migrated
- * libraries in the super-interface chain, since a legacy library is permitted
- * to override otherwise incompatible signatures for a method.
- *
- * @description Check that if opted-in class implements two classes (one is
- * legacy) and child type parameter is non-nullable, child opted-in class type
- * parameter cannot be [Null]. *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-
-abstract class DD1<X extends A> {}
-
-class D1<X extends A> implements D<X>, DD1<X> {}
-//                               ^^^^^^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
-main() {}
diff --git a/LanguageFeatures/nnbd/override_checking_legacy_futureor_lib.dart b/LanguageFeatures/nnbd/override_checking_legacy_futureor_lib.dart
new file mode 100644
index 0000000..d2fc093
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_legacy_futureor_lib.dart
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+/**
+ * Classes of this library are separated from 'override_checking_legacy lib' to
+ * avoid all the override_checking_A02_* tests failing because of the bug
+ * #39666.
+ *
+ * @author iarkh@unipro.ru
+ */
+// @dart=2.4
+// SharedOptions=--enable-experiment=non-nullable
+
+library override_legacy_futureor_lib;
+
+import "dart:async";
+import "../../Utils/expect.dart";
+
+class LEGACY_CLASS_FUTUREOR<T extends FutureOr>                   {}
+class LEGACY_CLASS_FUTUREORFUTUREOR<T extends FutureOr<FutureOr>> {}
+
+class LEGACY_CLASS_FUTUREORINT<T extends FutureOr<int>>           {}
+class LEGACY_CLASS_FUTUREORFUNCTION<T extends FutureOr<Function>> {}
diff --git a/LanguageFeatures/nnbd/override_checking_legacy_lib.dart b/LanguageFeatures/nnbd/override_checking_legacy_lib.dart
index 367521d..cdddccb 100644
--- a/LanguageFeatures/nnbd/override_checking_legacy_lib.dart
+++ b/LanguageFeatures/nnbd/override_checking_legacy_lib.dart
@@ -41,45 +41,14 @@
 }
 
 class LEGACY_GETTER {
-  int get getInt {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  Object get getObject {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  dynamic get getDynamic {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  Function get getFunction {
-    Expect.fail("This method should be overriden");
-    return null;
-  }
-
-  Null get getNull {
-    Expect.fail("This method should be overriden");
-    return null;
-  }
-
-  FutureOr get getFutureOr {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  FutureOr<int> get getFutureOrInt {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  FutureOr<Function> get getFutureOrFunction {
-    Expect.fail("This method should be overriden");
-    return null;
-  }
+  int get getInt                             => throw("This method should be overriden");
+  Object get getObject                       => throw("This method should be overriden");
+  dynamic get getDynamic                     => throw("This method should be overriden");
+  Function get getFunction                   => throw("This method should be overriden");
+  Null get getNull                           => throw("This method should be overriden");
+  FutureOr get getFutureOr                   => throw("This method should be overriden");
+  FutureOr<int> get getFutureOrInt           => throw("This method should be overriden");
+  FutureOr<Function> get getFutureOrFunction => throw("This method should be overriden");
 }
 
 class LEGACY_SETTER {
@@ -94,46 +63,18 @@
 }
 
 class LEGACY_RETURN {
-  int getInt() {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  Object getObject() {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  dynamic getDynamic() {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  Function getFunction() {
-    Expect.fail("This method should be overriden");
-    return null;
-  }
-
-  Null getNull() {
-    Expect.fail("This method should be overriden");
-    return null;
-  }
-
-  FutureOr getFutureOr() {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  FutureOr<int> getFutureOrInt() {
-    Expect.fail("This method should be overriden");
-    return -1;
-  }
-
-  FutureOr<Function> getFutureOrFunction() {
-    Expect.fail("This method should be overriden");
-    return null;
-  }
+  int getInt()                             => throw("This method should be overriden");
+  Object getObject()                       => throw("This method should be overriden");
+  dynamic getDynamic()                     => throw("This method should be overriden");
+  Function getFunction()                   => throw("This method should be overriden");
+  Null getNull()                           => throw("This method should be overriden");
+  FutureOr getFutureOr()                   => throw("This method should be overriden");
+  FutureOr<int> getFutureOrInt()           => throw("This method should be overriden");
+  FutureOr<Function> getFutureOrFunction() => throw("This method should be overriden");
 }
 
-class A {}
-class D<X extends A> {}
+class LEGACY_CLASS<T>                                             {}
+class LEGACY_CLASS_INT<T extends int>                             {}
+class LEGACY_CLASS_OBJECT<T extends Object>                       {}
+class LEGACY_CLASS_FUNCTION<T extends Function>                   {}
+class LEGACY_CLASS_NULL<T extends Null>                           {}