Fixed Issue #465: tests for overriding with NNBD re-named and corrected. New tests added.
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t06.dart b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t01.dart
similarity index 65%
rename from LanguageFeatures/nnbd/override_checking_A02_t06.dart
rename to LanguageFeatures/nnbd/override_checking_A02_FIELD_t01.dart
index b07244c..2e5b6b2 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t06.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t01.dart
@@ -16,35 +16,30 @@
*/
// SharedOptions=--enable-experiment=non-nullable
+import "dart:async";
import "../../Utils/expect.dart";
import "override_checking_legacy_lib.dart";
-class A1 extends A {
- int? aField1 = 0;
-}
-
-class A2 extends A {
- int? aField1 = null;
-}
-
-class A3 extends A {
- int? aField1;
+class A extends LEGACY_FIELD {
+ int? i;
+ Object? o;
+ dynamic d;
+ Function? func;
+ Null n;
+ FutureOr? f;
+ FutureOr<int>? fi;
+ FutureOr<Function>? ff;
+ void v;
}
main() {
- A1 a1 = A1();
- Expect.equals(0, a1.aField1);
- a1.aField1 = null;
- Expect.isNull(a1.aField1);
-
- A2 a2 = A2();
- Expect.isNull(a2.aField1);
- a2.aField1 = 4;
- Expect.equals(4, a2.aField1);
-
- A3 a3 = A3();
- a3.aField1 = 4;
- Expect.equals(4, a3.aField1);
- a3.aField1 = null;
- Expect.isNull(a3.aField1);
+ A a = A();
+ Expect.isNull(a.i);
+ Expect.isNull(a.d);
+ Expect.isNull(a.o);
+ Expect.isNull(a.func);
+ Expect.isNull(a.n);
+ Expect.isNull(a.f);
+ Expect.isNull(a.fi);
+ Expect.isNull(a.ff);
}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_FIELD_t02.dart b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t02.dart
new file mode 100644
index 0000000..317e4df
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t02.dart
@@ -0,0 +1,110 @@
+/*
+ * 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, opted-in
+ * field of non-nullable type cannot override legacy field, compile time error
+ * is thrown in this case.
+ *
+ * @author iarkh@unipro.ru
+*/
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "override_checking_legacy_lib.dart";
+
+class A1 extends LEGACY_FIELD {
+ int i;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class A2 extends LEGACY_FIELD {
+ int i = null;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o = null;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func = null;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi = null;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff = null;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+void testme() {}
+
+class A3 extends LEGACY_FIELD {
+ int i = 1;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o = "";
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func = testme;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi = 12345;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff = testme;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ A1();
+ A2();
+ A3();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_FIELD_t03.dart b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t03.dart
new file mode 100644
index 0000000..1f6d187
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t03.dart
@@ -0,0 +1,45 @@
+/*
+ * 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, opted-in
+ * field of nullable type can override legacy field.
+ *
+ * @author iarkh@unipro.ru
+*/
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class A implements LEGACY_FIELD {
+ int? i;
+ Object? o;
+ dynamic d;
+ Function? func;
+ Null n;
+ FutureOr? f;
+ FutureOr<int>? fi;
+ FutureOr<Function>? ff;
+ void v;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.i);
+ Expect.isNull(a.d);
+ Expect.isNull(a.o);
+ Expect.isNull(a.func);
+ Expect.isNull(a.n);
+ Expect.isNull(a.f);
+ Expect.isNull(a.fi);
+ Expect.isNull(a.ff);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_FIELD_t04.dart b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t04.dart
new file mode 100644
index 0000000..f5e9251
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t04.dart
@@ -0,0 +1,125 @@
+/*
+ * 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, opted-in
+ * field of non-nullable type cannot override legacy field, compile time error
+ * is thrown in this case.
+ *
+ * @author iarkh@unipro.ru
+*/
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "override_checking_legacy_lib.dart";
+
+class A1 implements LEGACY_FIELD {
+ int i;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ dynamic d;
+ Null n;
+ FutureOr f;
+ void v;
+}
+
+class A2 implements LEGACY_FIELD {
+ int i = null;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o = null;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func = null;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi = null;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff = null;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ dynamic d = null;
+ Null n = null;
+ FutureOr f = null;
+ void v = null;
+}
+
+void testme() {}
+
+class A3 implements LEGACY_FIELD {
+ int i = 1;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o = "";
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func = testme;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi = 12345;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff = testme;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ dynamic d = 1;
+ Null n = null;
+ FutureOr f = 1;
+ void v;
+}
+
+main() {
+ A1();
+ A2();
+ A3();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t40.dart b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t05.dart
similarity index 65%
rename from LanguageFeatures/nnbd/override_checking_A02_t40.dart
rename to LanguageFeatures/nnbd/override_checking_A02_FIELD_t05.dart
index 79b6844..fd2c49f 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t40.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t05.dart
@@ -16,35 +16,30 @@
*/
// SharedOptions=--enable-experiment=non-nullable
+import "dart:async";
import "../../Utils/expect.dart";
import "override_checking_legacy_lib.dart";
-class A1 with A {
- int? aField1 = 0;
-}
-
-class A2 with A {
- int? aField1 = null;
-}
-
-class A3 with A {
- int? aField1;
+class A with LEGACY_FIELD {
+ int? i;
+ Object? o;
+ dynamic d;
+ Function? func;
+ Null n;
+ FutureOr? f;
+ FutureOr<int>? fi;
+ FutureOr<Function>? ff;
+ void v;
}
main() {
- A1 a1 = A1();
- Expect.equals(0, a1.aField1);
- a1.aField1 = null;
- Expect.isNull(a1.aField1);
-
- A2 a2 = A2();
- Expect.isNull(a2.aField1);
- a2.aField1 = 4;
- Expect.equals(4, a2.aField1);
-
- A3 a3 = A3();
- a3.aField1 = 4;
- Expect.equals(4, a3.aField1);
- a3.aField1 = null;
- Expect.isNull(a3.aField1);
+ A a = A();
+ Expect.isNull(a.i);
+ Expect.isNull(a.d);
+ Expect.isNull(a.o);
+ Expect.isNull(a.func);
+ Expect.isNull(a.n);
+ Expect.isNull(a.f);
+ Expect.isNull(a.fi);
+ Expect.isNull(a.ff);
}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_FIELD_t06.dart b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t06.dart
new file mode 100644
index 0000000..c2d9ea0
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t06.dart
@@ -0,0 +1,110 @@
+/*
+ * 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,
+ * opted-in field of non-nullable type cannot override legacy field, compile
+ * time error is thrown in this case.
+ *
+ * @author iarkh@unipro.ru
+*/
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "override_checking_legacy_lib.dart";
+
+class A1 with LEGACY_FIELD {
+ int i;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+class A2 with LEGACY_FIELD {
+ int i = null;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o = null;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func = null;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi = null;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff = null;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+void testme() {}
+
+class A3 with LEGACY_FIELD {
+ int i = 1;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o = "";
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func = testme;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi = 12345;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff = testme;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+main() {
+ A1();
+ A2();
+ A3();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_FIELD_t07.dart b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t07.dart
new file mode 100644
index 0000000..12db758
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t07.dart
@@ -0,0 +1,58 @@
+/*
+ * 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) with some field, opted-in field of nullable type can override legacy
+ * field.
+ *
+ * @author iarkh@unipro.ru
+*/
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+abstract class AA {
+ int? i;
+ Object? o;
+ dynamic d;
+ Function? func;
+ Null n;
+ FutureOr? f;
+ FutureOr<int>? fi;
+ FutureOr<Function>? ff;
+ void v;
+}
+
+class A implements LEGACY_FIELD, AA {
+ int? i;
+ Object? o;
+ dynamic d;
+ Function? func;
+ Null n;
+ FutureOr? f;
+ FutureOr<int>? fi;
+ FutureOr<Function>? ff;
+ void v;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.i);
+ Expect.isNull(a.d);
+ Expect.isNull(a.o);
+ Expect.isNull(a.func);
+ Expect.isNull(a.n);
+ Expect.isNull(a.f);
+ Expect.isNull(a.fi);
+ Expect.isNull(a.ff);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_FIELD_t08.dart b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t08.dart
new file mode 100644
index 0000000..bc90403
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_FIELD_t08.dart
@@ -0,0 +1,137 @@
+/*
+ * 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) with some field, opted-in field of non-nullable type cannot override
+ * legacy field, compile time error is thrown in this case.
+ *
+ * @author iarkh@unipro.ru
+*/
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "override_checking_legacy_lib.dart";
+
+abstract class AA {
+ int? i;
+ Object? o;
+ dynamic d;
+ Function? func;
+ Null n;
+ FutureOr? f;
+ FutureOr<int>? fi;
+ FutureOr<Function>? ff;
+ void v;
+}
+
+class A1 implements LEGACY_FIELD, AA {
+ int i;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ dynamic d;
+ Null n;
+ FutureOr f;
+ void v;
+}
+
+class A2 implements LEGACY_FIELD, AA {
+ int i = null;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o = null;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func = null;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi = null;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff = null;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ dynamic d = null;
+ Null n = null;
+ FutureOr f = null;
+ void v = null;
+}
+
+void testme() {}
+
+class A3 implements LEGACY_FIELD, AA {
+ int i = 1;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Object o = "";
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ Function func = testme;
+// ^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<int> fi = 12345;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ FutureOr<Function> ff = testme;
+// ^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ dynamic d = 1;
+ Null n = null;
+ FutureOr f = 1;
+ void v;
+}
+
+main() {
+ A1();
+ A2();
+ A3();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t01.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t01.dart
new file mode 100644
index 0000000..dc2f818
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t01.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 opted-in class extends legacy class, opted-in
+ * getter of nullable type can override legacy getter which returns non-null
+ * value.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+class A extends LEGACY_GETTER {
+ int? get getInt => 1;
+ Object? get getObject => 1;
+ dynamic? get getDynamic => 1;
+ Function? get getFunction => testme;
+ Null? get getNull => null;
+ FutureOr? get getFutureOr => 1;
+ FutureOr<int>? get getFutureOrInt => 1;
+ FutureOr<Function>? get getFutureOrFunction => testme;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(1, a.getDynamic);
+ Expect.equals(testme, a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.equals(1, a.getFutureOr);
+ Expect.equals(1, a.getFutureOrInt);
+ Expect.equals(testme, a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t02.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t02.dart
new file mode 100644
index 0000000..363448b
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t02.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 opted-in class extends legacy class, opted-in
+ * getter of nullable type can override legacy getter which returns [null]
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class A extends LEGACY_GETTER {
+ int? get getInt => null;
+ Object? get getObject => null;
+ dynamic get getDynamic => null;
+ Function? get getFunction => null;
+ Null get getNull => null;
+ FutureOr get getFutureOr => null;
+ FutureOr<int>? get getFutureOrInt => null;
+ FutureOr<Function>? get getFutureOrFunction => null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.getInt);
+ Expect.isNull(a.getObject);
+ Expect.isNull(a.getDynamic);
+ Expect.isNull(a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.isNull(a.getFutureOr);
+ Expect.isNull(a.getFutureOrInt);
+ Expect.isNull(a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t03.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t03.dart
new file mode 100644
index 0000000..08e0779
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t03.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 opted-in class extends legacy class, opted-in
+ * getter of non-nullable type which returns non-null value can override legacy
+ * getter.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+class A extends LEGACY_GETTER {
+ int get getInt => 1;
+ Object get getObject => 1;
+ dynamic get getDynamic => 1;
+ Function get getFunction => testme;
+ Null get getNull => null;
+ FutureOr get getFutureOr => 1;
+ FutureOr<int> get getFutureOrInt => 1;
+ FutureOr<Function> get getFutureOrFunction => testme;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(1, a.getDynamic);
+ Expect.equals(testme, a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.equals(1, a.getFutureOr);
+ Expect.equals(1, a.getFutureOrInt);
+ Expect.equals(testme, a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t04.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t04.dart
new file mode 100644
index 0000000..9878435
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t04.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 opted-in class implements legacy class, opted-in
+ * getter of nullable type can override legacy getter which returns non-null
+ * value.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+class A implements LEGACY_GETTER {
+ int? get getInt => 1;
+ Object? get getObject => 1;
+ dynamic? get getDynamic => 1;
+ Function? get getFunction => testme;
+ Null? get getNull => null;
+ FutureOr? get getFutureOr => 1;
+ FutureOr<int>? get getFutureOrInt => 1;
+ FutureOr<Function>? get getFutureOrFunction => testme;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(1, a.getDynamic);
+ Expect.equals(testme, a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.equals(1, a.getFutureOr);
+ Expect.equals(1, a.getFutureOrInt);
+ Expect.equals(testme, a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t05.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t05.dart
new file mode 100644
index 0000000..132bc2b
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t05.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 opted-in class implements legacy class, opted-in
+ * getter of nullable type can override legacy getter which returns [null].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class A implements LEGACY_GETTER {
+ int? get getInt => null;
+ Object? get getObject => null;
+ dynamic get getDynamic => null;
+ Function? get getFunction => null;
+ Null get getNull => null;
+ FutureOr get getFutureOr => null;
+ FutureOr<int>? get getFutureOrInt => null;
+ FutureOr<Function>? get getFutureOrFunction => null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.getInt);
+ Expect.isNull(a.getObject);
+ Expect.isNull(a.getDynamic);
+ Expect.isNull(a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.isNull(a.getFutureOr);
+ Expect.isNull(a.getFutureOrInt);
+ Expect.isNull(a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t06.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t06.dart
new file mode 100644
index 0000000..c9de37c
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t06.dart
@@ -0,0 +1,46 @@
+/*
+ * 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, opted-in
+ * getter of non-nullable type can override legacy getter.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+class A implements LEGACY_GETTER {
+ int get getInt => 1;
+ Object get getObject => 1;
+ dynamic get getDynamic => 1;
+ Function get getFunction => testme;
+ Null get getNull => null;
+ FutureOr get getFutureOr => 1;
+ FutureOr<int> get getFutureOrInt => 1;
+ FutureOr<Function> get getFutureOrFunction => testme;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(1, a.getDynamic);
+ Expect.equals(testme, a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.equals(1, a.getFutureOr);
+ Expect.equals(1, a.getFutureOrInt);
+ Expect.equals(testme, a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t07.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t07.dart
new file mode 100644
index 0000000..11529ba
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t07.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 opted-in class is a mixin with legacy class,
+ * opted-in getter of nullable type can override legacy getter which returns
+ * non-null value.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+class A with LEGACY_GETTER {
+ int? get getInt => 1;
+ Object? get getObject => 1;
+ dynamic? get getDynamic => 1;
+ Function? get getFunction => testme;
+ Null? get getNull => null;
+ FutureOr? get getFutureOr => 1;
+ FutureOr<int>? get getFutureOrInt => 1;
+ FutureOr<Function>? get getFutureOrFunction => testme;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(1, a.getDynamic);
+ Expect.equals(testme, a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.equals(1, a.getFutureOr);
+ Expect.equals(1, a.getFutureOrInt);
+ Expect.equals(testme, a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t08.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t08.dart
new file mode 100644
index 0000000..452bfff
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t08.dart
@@ -0,0 +1,45 @@
+/*
+ * 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,
+ * opted-in getter of nullable type can override legacy getter which returns
+ * [null]
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class A with LEGACY_GETTER {
+ int? get getInt => null;
+ Object? get getObject => null;
+ dynamic get getDynamic => null;
+ Function? get getFunction => null;
+ Null get getNull => null;
+ FutureOr get getFutureOr => null;
+ FutureOr<int>? get getFutureOrInt => null;
+ FutureOr<Function>? get getFutureOrFunction => null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.getInt);
+ Expect.isNull(a.getObject);
+ Expect.isNull(a.getDynamic);
+ Expect.isNull(a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.isNull(a.getFutureOr);
+ Expect.isNull(a.getFutureOrInt);
+ Expect.isNull(a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t09.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t09.dart
new file mode 100644
index 0000000..dbe2739
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t09.dart
@@ -0,0 +1,46 @@
+/*
+ * 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,
+ * opted-in getter of non-nullable type can override legacy getter.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+class A with LEGACY_GETTER {
+ int get getInt => 1;
+ Object get getObject => 1;
+ dynamic get getDynamic => 1;
+ Function get getFunction => testme;
+ Null get getNull => null;
+ FutureOr get getFutureOr => 1;
+ FutureOr<int> get getFutureOrInt => 1;
+ FutureOr<Function> get getFutureOrFunction => testme;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(1, a.getDynamic);
+ Expect.equals(testme, a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.equals(1, a.getFutureOr);
+ Expect.equals(1, a.getFutureOrInt);
+ Expect.equals(testme, a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t10.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t10.dart
new file mode 100644
index 0000000..f021b78
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t10.dart
@@ -0,0 +1,58 @@
+/*
+ * 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) with some getter, opted-in getter of nullable type which returns
+ * non-null value can override legacy getter.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+abstract class AA {
+ int? get getInt;
+ Object? get getObject;
+ dynamic get getDynamic;
+ Function? get getFunction;
+ Null get getNull;
+ FutureOr get getFutureOr;
+ FutureOr<int>? get getFutureOrInt;
+ FutureOr<Function>? get getFutureOrFunction;
+}
+
+class A implements LEGACY_GETTER, AA {
+ int? get getInt => 1;
+ Object? get getObject => 1;
+ dynamic? get getDynamic => 1;
+ Function? get getFunction => testme;
+ Null? get getNull => null;
+ FutureOr? get getFutureOr => 1;
+ FutureOr<int>? get getFutureOrInt => 1;
+ FutureOr<Function>? get getFutureOrFunction => testme;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(1, a.getDynamic);
+ Expect.equals(testme, a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.equals(1, a.getFutureOr);
+ Expect.equals(1, a.getFutureOrInt);
+ Expect.equals(testme, a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t11.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t11.dart
new file mode 100644
index 0000000..af3e000
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t11.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 opted-in class implements two classes (one is
+ * legacy) with some getter, opted-in getter of nullable type which returns
+ * [null] value can override.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+abstract class AA {
+ int? get getInt;
+ Object? get getObject;
+ dynamic get getDynamic;
+ Function? get getFunction;
+ Null get getNull;
+ FutureOr get getFutureOr;
+ FutureOr<int>? get getFutureOrInt;
+ FutureOr<Function>? get getFutureOrFunction;
+}
+
+class A implements LEGACY_GETTER, AA {
+ int? get getInt => null;
+ Object? get getObject => null;
+ dynamic get getDynamic => null;
+ Function? get getFunction => null;
+ Null get getNull => null;
+ FutureOr get getFutureOr => null;
+ FutureOr<int>? get getFutureOrInt => null;
+ FutureOr<Function>? get getFutureOrFunction => null;
+}
+
+main() {
+ A a = A();
+ Expect.isNull(a.getInt);
+ Expect.isNull(a.getObject);
+ Expect.isNull(a.getDynamic);
+ Expect.isNull(a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.isNull(a.getFutureOr);
+ Expect.isNull(a.getFutureOrInt);
+ Expect.isNull(a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_GETTER_t12.dart b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t12.dart
new file mode 100644
index 0000000..27ea069
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_GETTER_t12.dart
@@ -0,0 +1,58 @@
+/*
+ * 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) with some getter, opted-in getter of non-nullable type can override
+ * legacy getter.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+abstract class AA {
+ int? get getInt;
+ Object? get getObject;
+ dynamic get getDynamic;
+ Function? get getFunction;
+ Null get getNull;
+ FutureOr get getFutureOr;
+ FutureOr<int>? get getFutureOrInt;
+ FutureOr<Function>? get getFutureOrFunction;
+}
+
+class A implements LEGACY_GETTER, AA {
+ int? get getInt => 1;
+ Object? get getObject => 1;
+ dynamic? get getDynamic => 1;
+ Function? get getFunction => testme;
+ Null? get getNull => null;
+ FutureOr? get getFutureOr => 1;
+ FutureOr<int>? get getFutureOrInt => 1;
+ FutureOr<Function>? get getFutureOrFunction => testme;
+}
+
+main() {
+ A a = A();
+ Expect.equals(1, a.getInt);
+ Expect.equals(1, a.getObject);
+ Expect.equals(1, a.getDynamic);
+ Expect.equals(testme, a.getFunction);
+ Expect.isNull(a.getNull);
+ Expect.equals(1, a.getFutureOr);
+ Expect.equals(1, a.getFutureOrInt);
+ Expect.equals(testme, a.getFutureOrFunction);
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_SETTER_t01.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t01.dart
new file mode 100644
index 0000000..e0c985e
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t01.dart
@@ -0,0 +1,69 @@
+/*
+ * 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, opted-in
+ * setter can have nullable argument and accept non-null values.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+class A extends LEGACY_SETTER {
+ void set setInt(int? i) {
+ Expect.equals(1, i);
+ }
+
+ void set setObject(Object? o) {
+ Expect.equals(1, o);
+ }
+
+ void set setDynamic(dynamic? d) {
+ Expect.equals(1, d);
+ }
+
+ void set setNull(Null? n) {
+ Expect.isNull(n);
+ }
+
+ void set setFunction(Function? f) {
+ Expect.equals(testme, f);
+ }
+ void set setFutureOr(FutureOr? f) {
+ Expect.equals(1, f);
+ }
+
+ void set setFutureOrInt(FutureOr<int>? f) {
+ Expect.equals(1, f);
+ }
+
+ void set setFutureOrFunction(FutureOr<Function>? f) {
+ Expect.equals(testme, f);
+ }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = 1;
+ a.setObject = 1;
+ a.setDynamic = 1;
+ a.setNull = null;
+ a.setFunction = testme;
+ a.setFutureOr = 1;
+ a.setFutureOrInt = 1;
+ a.setFutureOrFunction = testme;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_SETTER_t02.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t02.dart
new file mode 100644
index 0000000..61a3684
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t02.dart
@@ -0,0 +1,68 @@
+/*
+ * 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, opted-in
+ * setter can have nullable argument and accept [null].
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class A extends LEGACY_SETTER {
+ void set setInt(int? i) {
+ Expect.isNull(i);
+ }
+
+ void set setObject(Object? o) {
+ Expect.isNull(o);
+ }
+
+ void set setDynamic(dynamic d) {
+ Expect.isNull(d);
+ }
+
+ void set setNull(Null n) {
+ Expect.isNull(n);
+ }
+
+ void set setFunction(Function? f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOr(FutureOr f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOrInt(FutureOr<int>? f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOrFunction(FutureOr<Function>? f) {
+ Expect.isNull(f);
+ }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = null;
+ a.setObject = null;
+ a.setDynamic = null;
+ a.setNull = null;
+ a.setFunction = null;
+ a.setFutureOr = null;
+ a.setFutureOrInt = null;
+ a.setFutureOrFunction = null;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t11.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t03.dart
similarity index 61%
rename from LanguageFeatures/nnbd/override_checking_A02_t11.dart
rename to LanguageFeatures/nnbd/override_checking_A02_SETTER_t03.dart
index 74443ae..cac3350 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t11.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t03.dart
@@ -17,24 +17,41 @@
*/
// SharedOptions=--enable-experiment=non-nullable
+import "dart:async";
import "override_checking_legacy_lib.dart";
-class A1 extends A {
- void set set_field1(int i) {}
-// ^^^^^^^^^^
+class A extends LEGACY_SETTER {
+ void set setInt(int i) {}
+// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
- void set set_field2(int i) {}
-// ^^^^^^^^^^
+
+ void set setObject(Object o) {}
+// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
- void set set_field3(int i) {}
-// ^^^^^^^^^^
+ void set setFunction(Function f) {}
+// ^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
+ void set setFutureOrInt(FutureOr<int> f) {}
+// ^^^^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setFutureOrFunction(FutureOr<Function> f) {}
+// ^^^^^^^^^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setDynamic(dynamic d) {}
+ void set setNull(Null n) {}
+ void set setFutureOr(FutureOr f) {}
}
-main() {}
+main() {
+ A();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_SETTER_t04.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t04.dart
new file mode 100644
index 0000000..b86d7fc
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t04.dart
@@ -0,0 +1,69 @@
+/*
+ * 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 implement legacy class, child
+ * opted-in setter can have nullable argument and so accept non-null values.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+class A implements LEGACY_SETTER {
+ void set setInt(int? i) {
+ Expect.equals(1, i);
+ }
+
+ void set setObject(Object? o) {
+ Expect.equals(1, o);
+ }
+
+ void set setDynamic(dynamic? d) {
+ Expect.equals(1, d);
+ }
+
+ void set setNull(Null? n) {
+ Expect.isNull(n);
+ }
+
+ void set setFunction(Function? f) {
+ Expect.equals(testme, f);
+ }
+ void set setFutureOr(FutureOr? f) {
+ Expect.equals(1, f);
+ }
+
+ void set setFutureOrInt(FutureOr<int>? f) {
+ Expect.equals(1, f);
+ }
+
+ void set setFutureOrFunction(FutureOr<Function>? f) {
+ Expect.equals(testme, f);
+ }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = 1;
+ a.setObject = 1;
+ a.setDynamic = 1;
+ a.setNull = null;
+ a.setFunction = testme;
+ a.setFutureOr = 1;
+ a.setFutureOrInt = 1;
+ a.setFutureOrFunction = testme;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_SETTER_t05.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t05.dart
new file mode 100644
index 0000000..cfc0011
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t05.dart
@@ -0,0 +1,67 @@
+/*
+ * 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 implement legacy class, child
+ * opted-in setter can have nullable argument and so accept [null] values.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class A implements LEGACY_SETTER {
+ void set setInt(int? i) {
+ Expect.isNull(i);
+ }
+
+ void set setObject(Object? o) {
+ Expect.isNull(o);
+ }
+
+ void set setDynamic(dynamic d) {
+ Expect.isNull(d);
+ }
+
+ void set setNull(Null n) {
+ Expect.isNull(n);
+ }
+
+ void set setFunction(Function? f) {
+ Expect.isNull(f);
+ }
+ void set setFutureOr(FutureOr f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOrInt(FutureOr<int>? f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOrFunction(FutureOr<Function>? f) {
+ Expect.isNull(f);
+ }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = null;
+ a.setObject = null;
+ a.setDynamic = null;
+ a.setNull = null;
+ a.setFunction = null;
+ a.setFutureOr = null;
+ a.setFutureOrInt = null;
+ a.setFutureOrFunction = null;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t28.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t06.dart
similarity index 60%
rename from LanguageFeatures/nnbd/override_checking_A02_t28.dart
rename to LanguageFeatures/nnbd/override_checking_A02_SETTER_t06.dart
index 9c552a7..3b508b6 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t28.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t06.dart
@@ -16,33 +16,41 @@
*/
// SharedOptions=--enable-experiment=non-nullable
+import "dart:async";
import "override_checking_legacy_lib.dart";
-class A1 implements A {
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- int? get get_field1 => aField1;
- int? get get_field2 => aField2;
- int? get get_field3 => aField3;
-
- void set set_field1(int i) {}
-// ^^^^^^^^^^
+class A implements LEGACY_SETTER {
+ void set setInt(int i) {}
+// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
- void set set_field2(int i) {}
-// ^^^^^^^^^^
+
+ void set setObject(Object o) {}
+// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
- void set set_field3(int i) {}
-// ^^^^^^^^^^
+ void set setFunction(Function f) {}
+// ^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
- int test_return_nullable() => 1;
- Null test_return_never() => null;
+ void set setFutureOrInt(FutureOr<int> f) {}
+// ^^^^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setFutureOrFunction(FutureOr<Function> f) {}
+// ^^^^^^^^^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setDynamic(dynamic d) {}
+ void set setNull(Null n) {}
+ void set setFutureOr(FutureOr f) {}
}
-main() {}
+main() {
+ A();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_SETTER_t07.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t07.dart
new file mode 100644
index 0000000..52e0acc
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t07.dart
@@ -0,0 +1,69 @@
+/*
+ * 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 setter can have nullable argument and so accept non-null values.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+class A with LEGACY_SETTER {
+ void set setInt(int? i) {
+ Expect.equals(1, i);
+ }
+
+ void set setObject(Object? o) {
+ Expect.equals(1, o);
+ }
+
+ void set setDynamic(dynamic? d) {
+ Expect.equals(1, d);
+ }
+
+ void set setNull(Null? n) {
+ Expect.isNull(n);
+ }
+
+ void set setFunction(Function? f) {
+ Expect.equals(testme, f);
+ }
+ void set setFutureOr(FutureOr? f) {
+ Expect.equals(1, f);
+ }
+
+ void set setFutureOrInt(FutureOr<int>? f) {
+ Expect.equals(1, f);
+ }
+
+ void set setFutureOrFunction(FutureOr<Function>? f) {
+ Expect.equals(testme, f);
+ }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = 1;
+ a.setObject = 1;
+ a.setDynamic = 1;
+ a.setNull = null;
+ a.setFunction = testme;
+ a.setFutureOr = 1;
+ a.setFutureOrInt = 1;
+ a.setFutureOrFunction = testme;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_SETTER_t08.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t08.dart
new file mode 100644
index 0000000..9b1ee2c
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t08.dart
@@ -0,0 +1,68 @@
+/*
+ * 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 setter can have nullable argument and so accept null values.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+class A with LEGACY_SETTER {
+ void set setInt(int? i) {
+ Expect.isNull(i);
+ }
+
+ void set setObject(Object? o) {
+ Expect.isNull(o);
+ }
+
+ void set setDynamic(dynamic d) {
+ Expect.isNull(d);
+ }
+
+ void set setNull(Null n) {
+ Expect.isNull(n);
+ }
+
+ void set setFunction(Function? f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOr(FutureOr f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOrInt(FutureOr<int>? f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOrFunction(FutureOr<Function>? f) {
+ Expect.isNull(f);
+ }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = null;
+ a.setObject = null;
+ a.setDynamic = null;
+ a.setNull = null;
+ a.setFunction = null;
+ a.setFutureOr = null;
+ a.setFutureOrInt = null;
+ a.setFutureOrFunction = null;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t45.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t09.dart
similarity index 61%
rename from LanguageFeatures/nnbd/override_checking_A02_t45.dart
rename to LanguageFeatures/nnbd/override_checking_A02_SETTER_t09.dart
index 2acfd38..d5d348b 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t45.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t09.dart
@@ -16,23 +16,41 @@
*/
// SharedOptions=--enable-experiment=non-nullable
+import "dart:async";
import "override_checking_legacy_lib.dart";
-class A1 with A {
- void set set_field1(int i) {}
-// ^^^^^^^^^^
+class A with LEGACY_SETTER {
+ void set setInt(int i) {}
+// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
- void set set_field2(int i) {}
-// ^^^^^^^^^^
+
+ void set setObject(Object o) {}
+// ^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
- void set set_field3(int i) {}
-// ^^^^^^^^^^
+ void set setFunction(Function f) {}
+// ^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
+
+ void set setFutureOrInt(FutureOr<int> f) {}
+// ^^^^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setFutureOrFunction(FutureOr<Function> f) {}
+// ^^^^^^^^^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setDynamic(dynamic d) {}
+ void set setNull(Null n) {}
+ void set setFutureOr(FutureOr f) {}
}
-main() {}
+main() {
+ A();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_SETTER_t10.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t10.dart
new file mode 100644
index 0000000..214fa60
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t10.dart
@@ -0,0 +1,82 @@
+/*
+ * 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) with some setter, opted-in setter of nullable type can override
+ * legacy setter.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+abstract class AA {
+ void set setInt(int? i);
+ void set setObject(Object? o);
+ void set setDynamic(dynamic? d);
+ void set setNull(Null? n);
+ void set setFunction(Function? f);
+ void set setFutureOr(FutureOr? f);
+ void set setFutureOrInt(FutureOr<int>? f);
+ void set setFutureOrFunction(FutureOr<Function>? f);
+}
+
+class A implements AA, LEGACY_SETTER {
+ void set setInt(int? i) {
+ Expect.equals(1, i);
+ }
+
+ void set setObject(Object? o) {
+ Expect.equals(1, o);
+ }
+
+ void set setDynamic(dynamic? d) {
+ Expect.equals(1, d);
+ }
+
+ void set setNull(Null? n) {
+ Expect.isNull(n);
+ }
+
+ void set setFunction(Function? f) {
+ Expect.equals(testme, f);
+ }
+
+ void set setFutureOr(FutureOr? f) {
+ Expect.equals(1, f);
+ }
+
+ void set setFutureOrInt(FutureOr<int>? f) {
+ Expect.equals(1, f);
+ }
+
+ void set setFutureOrFunction(FutureOr<Function>? f) {
+ Expect.equals(testme, f);
+ }
+}
+
+main() {
+ A a = A();
+
+ a.setInt = 1;
+ a.setObject = 1;
+ a.setDynamic = 1;
+ a.setNull = null;
+ a.setFunction = testme;
+ a.setFutureOr = 1;
+ a.setFutureOrInt = 1;
+ a.setFutureOrFunction = testme;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_SETTER_t11.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t11.dart
new file mode 100644
index 0000000..dc8d7fa
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t11.dart
@@ -0,0 +1,82 @@
+/*
+ * 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) with some setter, opted-in setter of nullable type can override
+ * legacy setter.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "../../Utils/expect.dart";
+import "override_checking_legacy_lib.dart";
+
+void testme() {}
+
+abstract class AA {
+ void set setInt(int? i);
+ void set setObject(Object? o);
+ void set setDynamic(dynamic? d);
+ void set setNull(Null? n);
+ void set setFunction(Function? f);
+ void set setFutureOr(FutureOr? f);
+ void set setFutureOrInt(FutureOr<int>? f);
+ void set setFutureOrFunction(FutureOr<Function>? f);
+}
+
+class A implements AA, LEGACY_SETTER {
+ void set setInt(int? i) {
+ Expect.isNull(i);
+ }
+
+ void set setObject(Object? o) {
+ Expect.isNull(o);
+ }
+
+ void set setDynamic(dynamic d) {
+ Expect.isNull(d);
+ }
+
+ void set setNull(Null n) {
+ Expect.isNull(n);
+ }
+
+ void set setFunction(Function? f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOr(FutureOr f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOrInt(FutureOr<int>? f) {
+ Expect.isNull(f);
+ }
+
+ void set setFutureOrFunction(FutureOr<Function>? f) {
+ Expect.isNull(f);
+ }
+}
+
+ main() {
+ A a = A();
+
+ a.setInt = null;
+ a.setObject = null;
+ a.setDynamic = null;
+ a.setNull = null;
+ a.setFunction = null;
+ a.setFutureOr = null;
+ a.setFutureOrInt = null;
+ a.setFutureOrFunction = null;
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_SETTER_t12.dart b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t12.dart
new file mode 100644
index 0000000..639402a
--- /dev/null
+++ b/LanguageFeatures/nnbd/override_checking_A02_SETTER_t12.dart
@@ -0,0 +1,68 @@
+/*
+ * 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) with some setter, opted-in setter of non-nullable type cannot
+ * override legacy setter.
+ *
+ * @author iarkh@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+
+import "dart:async";
+import "override_checking_legacy_lib.dart";
+
+abstract class AA {
+ void set setInt(int? i);
+ void set setObject(Object? o);
+ void set setDynamic(dynamic? d);
+ void set setNull(Null? n);
+ void set setFunction(Function? f);
+ void set setFutureOr(FutureOr? f);
+ void set setFutureOrInt(FutureOr<int>? f);
+ void set setFutureOrFunction(FutureOr<Function>? f);
+}
+
+class A implements AA, LEGACY_SETTER {
+ void set setInt(int i) {}
+// ^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+
+ void set setObject(Object o) {}
+// ^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setFunction(Function f) {}
+// ^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setFutureOrInt(FutureOr<int> f) {}
+// ^^^^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setFutureOrFunction(FutureOr<Function> f) {}
+// ^^^^^^^^^^^^^^^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ void set setDynamic(dynamic d) {}
+ void set setNull(Null n) {}
+ void set setFutureOr(FutureOr f) {}
+}
+
+main() {
+ A();
+}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t07.dart b/LanguageFeatures/nnbd/override_checking_A02_t07.dart
deleted file mode 100644
index d828722..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t07.dart
+++ /dev/null
@@ -1,43 +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, opted-in
- * field of non-nullable type cannot override legacy field, compile time error
- * is thrown in this case.
- *
- * @author iarkh@unipro.ru
-*/
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-
-class A1 extends A {
- int aField1 = 0;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
-
-class A2 extends A {
- int aField1 = null;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
-
-class A3 extends A {
- int aField1;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
-
-main() {}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t08.dart b/LanguageFeatures/nnbd/override_checking_A02_t08.dart
deleted file mode 100644
index 58135d0..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t08.dart
+++ /dev/null
@@ -1,33 +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, opted-in
- * getter of nullable type can override legacy getter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class A1 extends A {
- int? get get_field1 => 1;
- int? get get_field2 => null;
- int? get get_field3 => -3;
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(1, a1.get_field1);
- Expect.isNull(a1.get_field2);
- Expect.equals(-3, a1.get_field3);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t09.dart b/LanguageFeatures/nnbd/override_checking_A02_t09.dart
deleted file mode 100644
index 5615a3a..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t09.dart
+++ /dev/null
@@ -1,33 +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, opted-in
- * getter of non-nullable type can override legacy getter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class A1 extends A {
- int get get_field1 => 1;
- int get get_field2 => -3;
- int get get_field3 => 28;
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(1, a1.get_field1);
- Expect.equals(-3, a1.get_field2);
- Expect.equals(28, a1.get_field3);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t10.dart b/LanguageFeatures/nnbd/override_checking_A02_t10.dart
deleted file mode 100644
index 5e66294..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t10.dart
+++ /dev/null
@@ -1,36 +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, opted-in
- * setter can have nullable argument and so accept null and non-null values.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class A1 extends A {
- void set set_field1(int? i) {
- Expect.equals(1, i);
- }
-
- void set set_field2(int? i) {
- Expect.isNull(i);
- }
-}
-
-main() {
- A1 a = A1();
- a.set_field1 = 1;
- a.set_field2 = null;
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t23.dart b/LanguageFeatures/nnbd/override_checking_A02_t23.dart
deleted file mode 100644
index 530dfa2..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t23.dart
+++ /dev/null
@@ -1,83 +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, opted-in
- * field of nullable type can override legacy field.
- *
- * @author iarkh@unipro.ru
-*/
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class A1 implements A {
- int? aField1 = 0;
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-class A2 implements A {
- int? aField1 = null;
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-class A3 implements A {
- int? aField1;
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(0, a1.aField1);
- a1.aField1 = null;
- Expect.isNull(a1.aField1);
-
- A2 a2 = A2();
- Expect.isNull(a2.aField1);
- a2.aField1 = 4;
- Expect.equals(4, a2.aField1);
-
- A3 a3 = A3();
- a3.aField1 = 4;
- Expect.equals(4, a3.aField1);
- a3.aField1 = null;
- Expect.isNull(a3.aField1);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t24.dart b/LanguageFeatures/nnbd/override_checking_A02_t24.dart
deleted file mode 100644
index aa6bb69..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t24.dart
+++ /dev/null
@@ -1,76 +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, opted-in
- * field of non-nullable type cannot override legacy field, compile time error
- * is thrown in this case.
- *
- * @author iarkh@unipro.ru
-*/
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-
-class A1 implements A {
- int aField1 = 0;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-class A2 implements A {
- int aField1 = null;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-class A3 implements A {
- int aField1;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-main() {}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t25.dart b/LanguageFeatures/nnbd/override_checking_A02_t25.dart
deleted file mode 100644
index 12b2d10..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t25.dart
+++ /dev/null
@@ -1,42 +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, opted-in
- * getter of nullable type can override legacy getter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class A1 implements A {
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- int? get get_field1 => 1;
- int? get get_field2 => null;
- int? get get_field3 => aField3;
-
- int test_return_nullable() => 1;
- Null test_return_never() => null;
- void set set_field1(int i) {}
- void set set_field2(int i) {}
- void set set_field3(int i) {}
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(1, a1.get_field1);
- Expect.isNull(a1.get_field2);
- Expect.isNull(a1.get_field3);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t26.dart b/LanguageFeatures/nnbd/override_checking_A02_t26.dart
deleted file mode 100644
index cf8b13d..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t26.dart
+++ /dev/null
@@ -1,42 +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, opted-in
- * getter of non-nullable type can override legacy getter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-import "../../Utils/expect.dart";
-
-class A1 implements A {
- int get get_field1 => 1;
- int get get_field2 => 2;
- int get get_field3 => 3;
-
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- int test_return_nullable() => 1;
- Null test_return_never() => null;
- void set set_field1(int i) {}
- void set set_field2(int i) {}
- void set set_field3(int i) {}
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(1, a1.get_field1);
- Expect.equals(2, a1.get_field2);
- Expect.equals(3, a1.get_field3);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t27.dart b/LanguageFeatures/nnbd/override_checking_A02_t27.dart
deleted file mode 100644
index d25151f..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t27.dart
+++ /dev/null
@@ -1,55 +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 implement legacy class, child
- * opted-in setter can have nullable argument and so accept null and non-null
- * values.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class A1 implements A {
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- int? get get_field1 => aField1;
- int? get get_field2 => aField2;
- int? get get_field3 => aField3;
- void set set_field1(int? i) { aField1 = i; }
- void set set_field2(int? i) { aField2 = i; }
- void set set_field3(int? i) { aField3 = i; }
-
- int test_return_nullable() => 1;
- Null test_return_never() => null;
-}
-
-main() {
- A1 a = A1();
-
- a.set_field1 = 5;
- Expect.equals(5, a.aField1);
- a.set_field1 = null;
- Expect.isNull(a.aField1);
-
- a.set_field2 = 5;
- Expect.equals(5, a.aField2);
- a.set_field2 = null;
- Expect.isNull(a.aField2);
-
- a.set_field3 = 5;
- Expect.equals(5, a.aField3);
- a.set_field3 = null;
- Expect.isNull(a.aField3);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t29.dart b/LanguageFeatures/nnbd/override_checking_A02_t29.dart
index d092f51..23a35d6 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t29.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_t29.dart
@@ -21,33 +21,14 @@
class A1 implements A {
int? test_return_nullable() => 2;
-
Null test_return_never() => null;
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
}
class A2 implements A {
int? test_return_nullable() => null;
-
Null test_return_never() => null;
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
}
+
main() {
Expect.equals(2, A1().test_return_nullable());
Expect.isNull(A2().test_return_nullable());
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t30.dart b/LanguageFeatures/nnbd/override_checking_A02_t30.dart
index c0718a0..412dc4f 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t30.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_t30.dart
@@ -21,17 +21,7 @@
class A1 implements A {
int test_return_nullable() => 2;
-
Null test_return_never() => null;
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t33.dart b/LanguageFeatures/nnbd/override_checking_A02_t33.dart
index 7253820..5872bd4 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t33.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_t33.dart
@@ -20,17 +20,7 @@
class A1 implements A {
Never test_return_never() => throw "It's impossible!";
-
int? test_return_nullable() { return 1; }
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t34.dart b/LanguageFeatures/nnbd/override_checking_A02_t34.dart
index 83c74cf..84c6cf6 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t34.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_t34.dart
@@ -21,17 +21,7 @@
class A1 implements A {
Never test_return_never() => throw "It's impossible!";
-
int? test_return_nullable() { return 1; }
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t41.dart b/LanguageFeatures/nnbd/override_checking_A02_t41.dart
deleted file mode 100644
index d3f26c1..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t41.dart
+++ /dev/null
@@ -1,43 +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,
- * opted-in field of non-nullable type cannot override legacy field, compile
- * time error is thrown in this case.
- *
- * @author iarkh@unipro.ru
-*/
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-
-class A1 with A {
- int aField1 = 0;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
-
-class A2 with A {
- int aField1 = null;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
-
-class A3 with A {
- int aField1;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-}
-
-main() {}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t42.dart b/LanguageFeatures/nnbd/override_checking_A02_t42.dart
deleted file mode 100644
index 0b3d814..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t42.dart
+++ /dev/null
@@ -1,36 +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,
- * opted-in getter of nullable type can override legacy getter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class A1 with A {
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- int? get get_field1 => aField1;
- int? get get_field2 => aField2;
- int? get get_field3 => aField3;
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(1, a1.get_field1);
- Expect.isNull(a1.get_field2);
- Expect.isNull(a1.get_field3);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t43.dart b/LanguageFeatures/nnbd/override_checking_A02_t43.dart
deleted file mode 100644
index c3c36fe..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t43.dart
+++ /dev/null
@@ -1,32 +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,
- * opted-in getter of non-nullable type can override legacy getter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class A1 with A {
- int? aField1 = 1;
- int? get get_field1 => 1;
- int? get get_field2 => 2;
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(1, a1.get_field1);
- Expect.equals(2, a1.get_field2);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t44.dart b/LanguageFeatures/nnbd/override_checking_A02_t44.dart
deleted file mode 100644
index 20555b2..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t44.dart
+++ /dev/null
@@ -1,36 +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 setter can have nullable argument and so accept null and non-null
- * values.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-class A1 with A {
- void set set_field1(int? i) {
- Expect.equals(1, i);
- }
- void set set_field2(int? i) {
- Expect.isNull(i);
- }
-}
-
-main() {
- A1 a = A1();
- a.set_field1 = 1;
- a.set_field1 = null;
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t57.dart b/LanguageFeatures/nnbd/override_checking_A02_t57.dart
deleted file mode 100644
index c5d1d34..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t57.dart
+++ /dev/null
@@ -1,88 +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) with some field, opted-in field of nullable type can override legacy
- * field.
- *
- * @author iarkh@unipro.ru
-*/
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-abstract class B {
- int? aField1;
-}
-
-class A1 implements A, B {
- int? aField1 = 0;
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-class A2 implements A, B {
- int? aField1 = null;
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-class A3 implements A, B {
- int? aField1;
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(0, a1.aField1);
- a1.aField1 = null;
- Expect.isNull(a1.aField1);
-
- A2 a2 = A2();
- Expect.isNull(a2.aField1);
- a2.aField1 = 4;
- Expect.equals(4, a2.aField1);
-
- A3 a3 = A3();
- a3.aField1 = 4;
- Expect.equals(4, a3.aField1);
- a3.aField1 = null;
- Expect.isNull(a3.aField1);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t58.dart b/LanguageFeatures/nnbd/override_checking_A02_t58.dart
deleted file mode 100644
index 39484ad..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t58.dart
+++ /dev/null
@@ -1,84 +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) with some field, opted-in field of non-nullable type cannot override
- * legacy field, compile time error is thrown in this case.
- *
- * @author iarkh@unipro.ru
-*/
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-
-abstract class B1 {
- int? aField1;
-}
-
-abstract class B2 {
- int aField1;
-}
-
-class A1 implements A, B1 {
- int aField1 = 0;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-class A2 implements A, B2 {
- int aField1 = 0;
-// ^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-class A3 implements A, B1 {
- int aField1 = 0;
-// ^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- int? test_return_nullable() => 1;
- Null test_return_never() => null;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
-}
-
-main() {}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t59.dart b/LanguageFeatures/nnbd/override_checking_A02_t59.dart
deleted file mode 100644
index 720f24b..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t59.dart
+++ /dev/null
@@ -1,49 +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) with some getter, opted-in getter of nullable type can override
- * legacy getter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-abstract class B {
- int? get get_field1;
- int? get get_field2;
- int? get get_field3;
-}
-
-class A1 implements A, B {
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- int? get get_field1 => aField1;
- int? get get_field2 => aField2;
- int? get get_field3 => aField3;
-
- int test_return_nullable() => 1;
- Null test_return_never() => null;
- void set set_field1(int i) {}
- void set set_field2(int i) {}
- void set set_field3(int i) {}
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(1, a1.get_field1);
- Expect.isNull(a1.get_field2);
- Expect.isNull(a1.get_field3);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t60.dart b/LanguageFeatures/nnbd/override_checking_A02_t60.dart
deleted file mode 100644
index 1103491..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t60.dart
+++ /dev/null
@@ -1,49 +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) with some getter, opted-in getter of non-nullable type can override
- * legacy getter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-abstract class B {
- int get get_field1;
- int get get_field2;
- int get get_field3;
-}
-
-class A1 implements A, B {
- int get get_field1 => 1;
- int get get_field2 => 2;
- int get get_field3 => 3;
-
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- int test_return_nullable() => 1;
- Null test_return_never() => null;
- void set set_field1(int i) {}
- void set set_field2(int i) {}
- void set set_field3(int i) {}
-}
-
-main() {
- A1 a1 = A1();
- Expect.equals(1, a1.get_field1);
- Expect.equals(2, a1.get_field2);
- Expect.equals(3, a1.get_field3);
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t61.dart b/LanguageFeatures/nnbd/override_checking_A02_t61.dart
deleted file mode 100644
index 0d0e284..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t61.dart
+++ /dev/null
@@ -1,52 +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) with some setter, opted-in setter of nullable type can override
- * legacy setter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "../../Utils/expect.dart";
-import "override_checking_legacy_lib.dart";
-
-abstract class B {
- void set set_field1(int? i);
- void set set_field2(int? i);
- void set set_field3(int? i);
-}
-
-class A1 implements A, B {
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- void set set_field1(int? i) {
- Expect.equals(5, i);
- }
- void set set_field2(int? i) {
- Expect.isNull(i);
- }
- void set set_field3(int? i) {}
-
- int? get get_field1 => aField1;
- int? get get_field2 => aField2;
- int? get get_field3 => aField3;
- int test_return_nullable() => 1;
- Null test_return_never() => null;
-}
-
-main() {
- A1 a = A1();
- a.set_field1 = 5;
- a.set_field2 = null;
-}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t62.dart b/LanguageFeatures/nnbd/override_checking_A02_t62.dart
deleted file mode 100644
index 7831019..0000000
--- a/LanguageFeatures/nnbd/override_checking_A02_t62.dart
+++ /dev/null
@@ -1,88 +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) with some setter, opted-in setter of non-nullable type cannot
- * override legacy setter.
- *
- * @author iarkh@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-
-import "override_checking_legacy_lib.dart";
-
-abstract class B1 {
- void set set_field1(int i);
- void set set_field2(int i);
- void set set_field3(int i);
-}
-
-abstract class B2 {
- void set set_field1(int? i);
- void set set_field2(int? i);
- void set set_field3(int? i);
-}
-
-class A1 implements A, B1 {
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- int? get get_field1 => aField1;
- int? get get_field2 => aField2;
- int? get get_field3 => aField3;
-
- void set set_field1(int i) {}
-// ^^^^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- void set set_field2(int i) {}
-// ^^^^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- void set set_field3(int i) {}
-// ^^^^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- int test_return_nullable() => 1;
- Null test_return_never() => null;
-}
-
-class A2 implements A, B2 {
- int? aField1 = 1;
- int? aField2 = null;
- int? aField3;
- int? get get_field1 => aField1;
- int? get get_field2 => aField2;
- int? get get_field3 => aField3;
-
- void set set_field1(int i) {}
-// ^^^^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- void set set_field2(int i) {}
-// ^^^^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- void set set_field3(int i) {}
-// ^^^^^^^^^^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- int test_return_nullable() => 1;
- Null test_return_never() => null;
-}
-
-main() {}
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t63.dart b/LanguageFeatures/nnbd/override_checking_A02_t63.dart
index 7f7db63..e470cfe 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t63.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_t63.dart
@@ -29,32 +29,12 @@
class A1 implements A, B1 {
int? test_return_nullable() => null;
-
Null test_return_never() => null;
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
}
class A2 implements A, B2 {
int test_return_nullable() => 2;
-
Null test_return_never() => null;
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) { aField1 = -1; }
- void set set_field2(int? i) { aField1 = -2; }
- void set set_field3(int? i) { aField1 = -3; }
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t64.dart b/LanguageFeatures/nnbd/override_checking_A02_t64.dart
index 3f6478d..8dc6a5b 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t64.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_t64.dart
@@ -29,32 +29,12 @@
class A1 implements A, B1 {
int test_return_nullable() => 1;
-
Null test_return_never() => null;
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
}
class A2 implements A, B2 {
int test_return_nullable() => 2;
-
Null test_return_never() => null;
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) { aField1 = -1; }
- void set set_field2(int? i) { aField1 = -2; }
- void set set_field3(int? i) { aField1 = -3; }
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t67.dart b/LanguageFeatures/nnbd/override_checking_A02_t67.dart
index 472f37d..c375c44 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t67.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_t67.dart
@@ -24,17 +24,7 @@
class A1 implements A {
Never test_return_never() => throw "It's impossible!";
-
int? test_return_nullable() => 1;
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_A02_t68.dart b/LanguageFeatures/nnbd/override_checking_A02_t68.dart
index d76a92d..a1d5909 100644
--- a/LanguageFeatures/nnbd/override_checking_A02_t68.dart
+++ b/LanguageFeatures/nnbd/override_checking_A02_t68.dart
@@ -23,17 +23,7 @@
class A1 implements A {
Never test_return_never() => throw "It's impossible!";
-
int? test_return_nullable() => 1;
- int? aField1 = 1;
- int? aField2 = 2;
- int? aField3 = 3;
- int? get get_field1 => -1;
- int? get get_field2 => -2;
- int? get get_field3 => -3;
- void set set_field1(int? i) {}
- void set set_field2(int? i) {}
- void set set_field3(int? i) {}
}
main() {
diff --git a/LanguageFeatures/nnbd/override_checking_legacy_lib.dart b/LanguageFeatures/nnbd/override_checking_legacy_lib.dart
index 6936de1..c8bf929 100644
--- a/LanguageFeatures/nnbd/override_checking_legacy_lib.dart
+++ b/LanguageFeatures/nnbd/override_checking_legacy_lib.dart
@@ -28,6 +28,71 @@
void test_nondefault({int i}) { Expect.fail("This method should be overriden"); }
}
+class LEGACY_FIELD {
+ int i;
+ Object o;
+ dynamic d;
+ Function func;
+ Null n;
+ FutureOr f;
+ FutureOr<int> fi;
+ FutureOr<Function> ff;
+ void v;
+}
+
+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;
+ }
+}
+
+class LEGACY_SETTER {
+ void set setInt(int i) { Expect.fail("This method should be overriden"); }
+ void set setObject(Object o) { Expect.fail("This method should be overriden"); }
+ void set setDynamic(dynamic d) { Expect.fail("This method should be overriden"); }
+ void set setNull(Null n) { Expect.fail("This method should be overriden"); }
+ void set setFunction(Function f) { Expect.fail("This method should be overriden"); }
+ void set setFutureOr(FutureOr f) { Expect.fail("This method should be overriden"); }
+ void set setFutureOrInt(FutureOr<int> i) { Expect.fail("This method should be overriden"); }
+ void set setFutureOrFunction(FutureOr<Function> f) { Expect.fail("This method should be overriden"); }
+}
+
class A {
int test_return_nullable() {
Expect.fail("This method should be overriden");
@@ -38,37 +103,6 @@
Expect.fail("This method should be overriden");
return null;
}
-
- int aField1 = -1;
- int aField2 = null;
- int aField3;
-
- int get get_field1 {
- Expect.fail("This method should be overriden");
- return -1;
- }
-
- int get get_field2 {
- Expect.fail("This method should be overriden");
- return -1;
- }
-
- int get get_field3 {
- Expect.fail("This method should be overriden");
- return -1;
- }
-
- void set set_field1(int i) {
- Expect.fail("This method should be overriden");
- }
-
- void set set_field2(int i) {
- Expect.fail("This method should be overriden");
- }
-
- void set set_field3(int i) {
- Expect.fail("This method should be overriden");
- }
}
class D<X extends A> {}