#389. Fix NNBD static errors tests for X&S types where S is non-nullable
diff --git a/LanguageFeatures/nnbd/static_errors_A22_t10.dart b/LanguageFeatures/nnbd/static_errors_A22_t10.dart
index ed13955..350dcf3 100644
--- a/LanguageFeatures/nnbd/static_errors_A22_t10.dart
+++ b/LanguageFeatures/nnbd/static_errors_A22_t10.dart
@@ -20,15 +20,16 @@
*/
// SharedOptions=--enable-experiment=non-nullable
-class X {}
-
class S {}
-class C = X? with S;
+dynamic getDynamic(dynamic v) => v;
main() {
- C c = null;
+ var v = getDynamic(new S());
+ if (v is S) {
+ v = null;
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
+ }
}
diff --git a/LanguageFeatures/nnbd/static_errors_A22_t11.dart b/LanguageFeatures/nnbd/static_errors_A22_t11.dart
index bcda655..561cb3b 100644
--- a/LanguageFeatures/nnbd/static_errors_A22_t11.dart
+++ b/LanguageFeatures/nnbd/static_errors_A22_t11.dart
@@ -15,22 +15,23 @@
* X & S where S is non-nullable
*
* @description Check that null cannot be assigned to non-nullable type. Test
- * X & S where S is non-nullable
+ * X & S where S is non-nullable. Test type aliases
* @author sgrekhov@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
-class X {}
-
class S {}
-typedef XAlias = X?;
+typedef SAlias = S;
-class C = XAlias with S;
+dynamic getDynamic(dynamic v) => v;
main() {
- C c = null;
+ var v = getDynamic(new S());
+ if (v is SAlias) {
+ v = null;
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
+ }
}
diff --git a/LanguageFeatures/nnbd/static_errors_A22_t12.dart b/LanguageFeatures/nnbd/static_errors_A22_t12.dart
index 93ffa9c..04211ce 100644
--- a/LanguageFeatures/nnbd/static_errors_A22_t12.dart
+++ b/LanguageFeatures/nnbd/static_errors_A22_t12.dart
@@ -21,13 +21,14 @@
// SharedOptions=--enable-experiment=non-nullable
import "legacy_library_lib.dart";
-class S {}
-
-class C = A with S;
+class S extends A {}
main() {
- C c = null;
+ A a = new S();
+ if (a is S) {
+ a = null;
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
+ }
}
diff --git a/LanguageFeatures/nnbd/static_errors_A22_t13.dart b/LanguageFeatures/nnbd/static_errors_A22_t13.dart
index 651ded6..735aace 100644
--- a/LanguageFeatures/nnbd/static_errors_A22_t13.dart
+++ b/LanguageFeatures/nnbd/static_errors_A22_t13.dart
@@ -19,17 +19,18 @@
* @author sgrekhov@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
-import "legacy_library_lib.dart";
+import "legacy_library_aliases_lib.dart";
-typedef AAlias = A;
+class S extends AAlias {}
-class S {}
-
-class C = AAlias with S;
+typedef SAlias = S;
main() {
- C c = null;
+ AAlias a = new S();
+ if (a is SAlias) {
+ a = null;
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
+ }
}