#1243 Runtime type checks added to Spread collections tests
diff --git a/LanguageFeatures/Spread-collections/Ambiguity_A02_t06.dart b/LanguageFeatures/Spread-collections/Ambiguity_A02_t06.dart
index 727fe8d..33a1688 100644
--- a/LanguageFeatures/Spread-collections/Ambiguity_A02_t06.dart
+++ b/LanguageFeatures/Spread-collections/Ambiguity_A02_t06.dart
@@ -9,12 +9,13 @@
/// @description Checks that empty collection is a map.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
main() {
Expect.isTrue({} is Map);
+ Expect.runtimeIsType<Map>({});
dynamic map = {};
Expect.isTrue(map is Map);
+ Expect.runtimeIsType<Map>(map);
}
diff --git a/LanguageFeatures/Spread-collections/Ambiguity_A03_t01.dart b/LanguageFeatures/Spread-collections/Ambiguity_A03_t01.dart
index 38deab0..dd67809 100644
--- a/LanguageFeatures/Spread-collections/Ambiguity_A03_t01.dart
+++ b/LanguageFeatures/Spread-collections/Ambiguity_A03_t01.dart
@@ -16,7 +16,6 @@
/// @description Checks that [setOrMapLiteral] has one type argument, it's a set.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
main() {
@@ -25,7 +24,9 @@
var res1 = <int>{...aSet};
Expect.isTrue(res1 is Set);
+ Expect.runtimeIsType<Set>(res1);
var res2 = <Object>{...aList};
Expect.isTrue(res2 is Set);
+ Expect.runtimeIsType<Object>(res2);
}
diff --git a/LanguageFeatures/Spread-collections/Ambiguity_A03_t03.dart b/LanguageFeatures/Spread-collections/Ambiguity_A03_t03.dart
index ccd2088..6d3f35c 100644
--- a/LanguageFeatures/Spread-collections/Ambiguity_A03_t03.dart
+++ b/LanguageFeatures/Spread-collections/Ambiguity_A03_t03.dart
@@ -16,7 +16,6 @@
/// @description Checks that [setOrMapLiteral] has one type argument, it's a set.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
main() {
@@ -25,7 +24,9 @@
var res1 = <int>{...?aSet};
Expect.isTrue(res1 is Set);
+ Expect.runtimeIsType<Set>(res1);
var res2 = <Object>{...?aList};
Expect.isTrue(res2 is Set);
+ Expect.runtimeIsType<Set>(res2);
}
diff --git a/LanguageFeatures/Spread-collections/Ambiguity_A03_t05.dart b/LanguageFeatures/Spread-collections/Ambiguity_A03_t05.dart
index 035a898..986b457 100644
--- a/LanguageFeatures/Spread-collections/Ambiguity_A03_t05.dart
+++ b/LanguageFeatures/Spread-collections/Ambiguity_A03_t05.dart
@@ -16,7 +16,6 @@
/// @description Checks that [setOrMapLiteral] has one type argument, it's a set.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
main() {
@@ -26,9 +25,11 @@
var res1 = <int>{...aSet};
Expect.isTrue(res1 is Set);
+ Expect.runtimeIsType<Set>(res1);
var res2 = <Object>{...aList};
Expect.isTrue(res2 is Set);
+ Expect.runtimeIsType<Set>(res2);
var res3;
Expect.throws(() => res3 = <int>{...aMap});
diff --git a/LanguageFeatures/Spread-collections/Ambiguity_A04_t01.dart b/LanguageFeatures/Spread-collections/Ambiguity_A04_t01.dart
index 2649aaa..a22dffe 100644
--- a/LanguageFeatures/Spread-collections/Ambiguity_A04_t01.dart
+++ b/LanguageFeatures/Spread-collections/Ambiguity_A04_t01.dart
@@ -23,4 +23,5 @@
var res = <int, int>{...aMap};
Expect.isTrue(res is Map);
+ Expect.runtimeIsType<Map>(res);
}
diff --git a/LanguageFeatures/Spread-collections/Ambiguity_A04_t03.dart b/LanguageFeatures/Spread-collections/Ambiguity_A04_t03.dart
index bbd620c..b78ad20 100644
--- a/LanguageFeatures/Spread-collections/Ambiguity_A04_t03.dart
+++ b/LanguageFeatures/Spread-collections/Ambiguity_A04_t03.dart
@@ -23,4 +23,5 @@
var res = <int, int>{...?aMap};
Expect.isTrue(res is Map);
+ Expect.runtimeIsType<Map>(res);
}
diff --git a/LanguageFeatures/Spread-collections/Ambiguity_A04_t05.dart b/LanguageFeatures/Spread-collections/Ambiguity_A04_t05.dart
index 149c783..b2a9e17 100644
--- a/LanguageFeatures/Spread-collections/Ambiguity_A04_t05.dart
+++ b/LanguageFeatures/Spread-collections/Ambiguity_A04_t05.dart
@@ -25,6 +25,7 @@
var res1 = <int, int>{...?aMap};
Expect.isTrue(res1 is Map);
+ Expect.runtimeIsType<Map>(res1);
var res2;
Expect.throws(() => res2 = <int, int>{...aList});
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t01.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t01.dart
index 599c26f..826dde2 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t01.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t01.dart
@@ -11,7 +11,6 @@
/// or set.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
const l1 = [];
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t03.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t03.dart
index c0e45a7..834f94b 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t03.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t03.dart
@@ -11,7 +11,6 @@
/// constant list or set.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class A {
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t04.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t04.dart
index e6d916d..2551ced 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t04.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t04.dart
@@ -11,7 +11,6 @@
/// element is not potentially constant list or set.
/// @author iarkh@unipro.ru
-
class MyClass {
final String a;
const MyClass(Object o) : a = o as String;
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t05.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t05.dart
index 5e733ec..a31655d 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t05.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t05.dart
@@ -11,7 +11,6 @@
/// element is not potentially constant list or set.
/// @author iarkh@unipro.ru
-
class A {
const A();
}
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t10.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t10.dart
index 48bffb5..3c2a517 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t10.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t10.dart
@@ -11,7 +11,6 @@
/// constant list or set.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
Set emptyset = {};
@@ -29,7 +28,6 @@
const MyClass(Object o) : a = o as String;
}
-
main() {
const Set s1 = {...(A() is B ? [12345] : [])};
Expect.setEquals(emptyset, s1);
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t11.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t11.dart
index 864f21a..e892ca3 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t11.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t11.dart
@@ -24,7 +24,6 @@
const MyClass(Object o) : a = o as String;
}
-
main() {
const Set l4 = {...(MyClass(12345) is MyClass ? [12] : [])};
// ^^^^^^^^^^^^^
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t12.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t12.dart
index ef0ec33..9b487fa 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t12.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t12.dart
@@ -11,7 +11,6 @@
/// element is not a potentially constant list or set.
/// @author iarkh@unipro.ru
-
class A {
const A();
}
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t17.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t17.dart
index bc41828..de3569e 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t17.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t17.dart
@@ -11,7 +11,6 @@
/// constant map.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class A {
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t19.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t19.dart
index f324636..e377e81 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A09_t19.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A09_t19.dart
@@ -11,7 +11,6 @@
/// constant map.
/// @author iarkh@unipro.ru
-
class MyClass {
const MyClass();
}
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t03.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t03.dart
index bef450c..0bb8f8c 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t03.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t03.dart
@@ -12,7 +12,6 @@
/// potentially constant list or set or [null].
/// @author iarkh@unipro.ru
-
class MyClass {
final String a;
const MyClass(Object o) : a = o as String;
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t04.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t04.dart
index 7516017..11a8a50 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t04.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t04.dart
@@ -12,7 +12,6 @@
/// potentially constant list or set or [null].
/// @author iarkh@unipro.ru
-
class A {
const A();
}
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t10.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t10.dart
index 385d31c..da3829c 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t10.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t10.dart
@@ -12,7 +12,6 @@
/// potentially constant list or set.
/// @author iarkh@unipro.ru
-
class A {
const A();
}
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t11.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t11.dart
index f8f3514..7dd3d05 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t11.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t11.dart
@@ -12,7 +12,6 @@
/// potentially constant list or set.
/// @author iarkh@unipro.ru
-
class MyClass {
final String a;
const MyClass(Object o) : a = o as String;
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t16.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t16.dart
index ff019e5..60b9808 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t16.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t16.dart
@@ -12,7 +12,6 @@
/// potentially constant map or [null].
/// @author iarkh@unipro.ru
-
class A {
const A();
}
diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t17.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t17.dart
index d49b105..adbcfc4 100644
--- a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t17.dart
+++ b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t17.dart
@@ -12,7 +12,6 @@
/// potentially constant map or null.
/// @author iarkh@unipro.ru
-
class MyClass {
final String a;
const MyClass(Object o) : a = o as String;
diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_List_A01_t01.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_List_A01_t01.dart
index 3a1a803..a187b43 100644
--- a/LanguageFeatures/Spread-collections/DynamicSemantics_List_A01_t01.dart
+++ b/LanguageFeatures/Spread-collections/DynamicSemantics_List_A01_t01.dart
@@ -10,7 +10,6 @@
/// @description Checks that instance of [List<E>] is created for a list literal
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
main() {
@@ -30,4 +29,8 @@
Expect.isTrue(<String>[...?list3] is List<String>);
Expect.isTrue(<int>[...?list3] is List<int>);
Expect.isTrue([...list4] is List<Object?>);
+ Expect.runtimeIsType<List<String>>(<String>[...list2, "123"]);
+ Expect.runtimeIsType<List<String>>(<String>[...?list3]);
+ Expect.runtimeIsType<List<int>>(<int>[...?list3] );
+ Expect.runtimeIsType<List<Object?>>([...list4]);
}
diff --git a/LanguageFeatures/Spread-collections/Syntax_A03_t01.dart b/LanguageFeatures/Spread-collections/Syntax_A03_t01.dart
index 0e224f0..0646083 100644
--- a/LanguageFeatures/Spread-collections/Syntax_A03_t01.dart
+++ b/LanguageFeatures/Spread-collections/Syntax_A03_t01.dart
@@ -13,11 +13,12 @@
/// three or more type arguments.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
main() {
var a;
Expect.isTrue(<int>{} is Set);
Expect.isTrue(<int, int>{} is Map);
+ Expect.runtimeIsType<Set>(<int>{});
+ Expect.runtimeIsType<Map>(<int, int>{});
}
diff --git a/LanguageFeatures/Spread-collections/TypeInference_A01_t01.dart b/LanguageFeatures/Spread-collections/TypeInference_A01_t01.dart
index b43c4a0..5c6e464 100644
--- a/LanguageFeatures/Spread-collections/TypeInference_A01_t01.dart
+++ b/LanguageFeatures/Spread-collections/TypeInference_A01_t01.dart
@@ -9,7 +9,6 @@
/// the list literal
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class A {}
diff --git a/LanguageFeatures/Spread-collections/TypeInference_A01_t02.dart b/LanguageFeatures/Spread-collections/TypeInference_A01_t02.dart
index 5aefbe8..016fcb3 100644
--- a/LanguageFeatures/Spread-collections/TypeInference_A01_t02.dart
+++ b/LanguageFeatures/Spread-collections/TypeInference_A01_t02.dart
@@ -9,7 +9,6 @@
/// the set literal
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class A {}
@@ -30,25 +29,32 @@
Set set1 = <int>{2, 7, ...int_list, 4};
Expect.isTrue(set1 is Set<int>);
+ Expect.runtimeIsType<Set<int>>(set1);
Set set2 = <A>{a, ...a_list};
Expect.isTrue(set2 is Set<A>);
+ Expect.runtimeIsType<Set<A>>(set2);
Set set3 = <A>{a, ...b_list};
Expect.isTrue(set3 is Set<A>);
+ Expect.runtimeIsType<Set<A>>(set3);
Set set4 = <A>{a, c, ...c_list, b};
Expect.isTrue(set4 is Set<A>);
+ Expect.runtimeIsType<Set<A>>(set4);
Set set5 = <A>{a, b, c, ...c_list, new B(), ...a_list, ...b_list, new A()};
Expect.isTrue(set5 is Set<A>);
+ Expect.runtimeIsType<Set<A>>(set5);
Set set6 = <B>{b, ...b_list, c, ...c_list};
Expect.isTrue(set6 is Set<B>);
+ Expect.runtimeIsType<Set<B>>(set6);
Set set7 = {123, "123", null, a, ...a_list, ...?b_list, c, b, ...?c_list,
...str_list, ...int_list, null, 1499, []};
Expect.isTrue(set7 is Set<Object?>);
+ Expect.runtimeIsType<Set<Object?>>(set7);
Set set8;
Expect.throws(() => set8 = <int>{...str_list});
diff --git a/LanguageFeatures/Spread-collections/TypeInference_A02_t01.dart b/LanguageFeatures/Spread-collections/TypeInference_A02_t01.dart
index 4d4512e..1860435 100644
--- a/LanguageFeatures/Spread-collections/TypeInference_A02_t01.dart
+++ b/LanguageFeatures/Spread-collections/TypeInference_A02_t01.dart
@@ -8,7 +8,6 @@
/// in the list literal
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class A {}
@@ -27,92 +26,179 @@
C c = new C();
Expect.isTrue([...int_list] is List<int>);
+ Expect.runtimeIsType<List<int>>([...int_list]);
Expect.isTrue(["test", "a", ...?str_list, "ooooo"] is List<String>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<String>' which excludes null.
+ Expect.runtimeIsType<List<String>>(["test", "a", ...?str_list, "ooooo"]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<String>' which excludes null.
Expect.isTrue([...a_list] is List<A>);
+ Expect.runtimeIsType<List<A>>([...a_list]);
Expect.isTrue([a, ...?a_list] is List<A>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
+ Expect.runtimeIsType<List<A>>([a, ...?a_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
+
Expect.isTrue([...b_list] is List<A>);
+ Expect.runtimeIsType<List<A>>([...b_list]);
Expect.isTrue([a, ...?b_list] is List<A>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
+ Expect.runtimeIsType<List<A>>([a, ...?b_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
Expect.isTrue([...c_list] is List<A>);
+ Expect.runtimeIsType<List<A>>([...c_list]);
Expect.isTrue([a, ...?c_list] is List<A>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<List<A>>([a, ...?c_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isTrue([a, ...a_list, ...b_list, b] is List<A>);
+ Expect.runtimeIsType<List<A>>([a, ...a_list, ...b_list, b]);
Expect.isTrue([a, b, c, ...a_list, ...b_list, ...?c_list] is List<A>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<List<A>>([a, b, c, ...a_list, ...b_list, ...?c_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isTrue([a, ...a_list, ...b_list, b] is List<A>);
+ Expect.runtimeIsType<List<A>>([a, ...a_list, ...b_list, b]);
Expect.isFalse([...a_list] is List<B>);
+ Expect.runtimeIsNotType<List<B>>([...a_list]);
Expect.isFalse([b, ...?a_list] is List<B>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
+ Expect.runtimeIsNotType<List<B>>([b, ...?a_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
Expect.isTrue([...b_list] is List<B>);
+ Expect.runtimeIsType<List<B>>([...b_list]);
Expect.isTrue([b, ...?b_list] is List<B>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
+ Expect.runtimeIsType<List<B>>([b, ...?b_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
Expect.isTrue([...c_list] is List<B>);
+ Expect.runtimeIsType<List<B>>([...c_list]);
Expect.isTrue([b, ...?c_list] is List<B>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<List<B>>([b, ...?c_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isFalse([c, ...a_list, ...b_list, b] is List<B>);
+ Expect.runtimeIsNotType<List<B>>([c, ...a_list, ...b_list, b]);
Expect.isFalse([b, c, ...a_list, ...b_list, ...?c_list] is List<B>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsNotType<List<B>>([b, c, ...a_list, ...b_list, ...?c_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isTrue([b, ...c_list, ...b_list, b] is List<B>);
+ Expect.runtimeIsType<List<B>>([b, ...c_list, ...b_list, b]);
Expect.isFalse([...a_list] is List<C>);
+ Expect.runtimeIsNotType<List<C>>([...a_list]);
Expect.isFalse([c, ...?a_list] is List<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
+ Expect.runtimeIsNotType<List<C>>([c, ...?a_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
Expect.isFalse([...b_list] is List<C>);
+ Expect.runtimeIsNotType<List<C>>([...b_list]);
Expect.isFalse([c, ...?b_list] is List<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
+ Expect.runtimeIsNotType<List<C>>([c, ...?b_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
Expect.isTrue([...c_list] is List<C>);
+ Expect.runtimeIsType<List<C>>([...c_list]);
Expect.isTrue([...?c_list] is List<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<List<C>>([...?c_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isTrue([c, ...?c_list] is List<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<List<C>>([c, ...?c_list]);
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isFalse([c, ...a_list, ...b_list, c] is List<C>);
+ Expect.runtimeIsNotType<List<C>>([c, ...a_list, ...b_list, c]);
Expect.isFalse([c, ...a_list, ...b_list, ...?c_list] is List<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsNotType<List<C>>([c, ...a_list, ...b_list, ...?c_list] );
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isFalse([a, ...c_list, ...b_list, b] is List<C>);
+ Expect.runtimeIsNotType<List<C>>([a, ...c_list, ...b_list, b]);
}
diff --git a/LanguageFeatures/Spread-collections/TypeInference_A02_t02.dart b/LanguageFeatures/Spread-collections/TypeInference_A02_t02.dart
index b4af091..ae5d8dd 100644
--- a/LanguageFeatures/Spread-collections/TypeInference_A02_t02.dart
+++ b/LanguageFeatures/Spread-collections/TypeInference_A02_t02.dart
@@ -8,7 +8,6 @@
/// in the set literal
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class A {}
@@ -27,92 +26,178 @@
C c = new C();
Expect.isTrue({...int_list} is Set<int>);
+ Expect.runtimeIsType<Set<int>>({...int_list});
Expect.isTrue({"test", "a", ...?str_list, "ooooo"} is Set<String>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<String>' which excludes null.
+ Expect.runtimeIsType<Set<String>>({"test", "a", ...?str_list, "ooooo"});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<String>' which excludes null.
Expect.isTrue({...a_list} is Set<A>);
+ Expect.runtimeIsType<Set<A>>({...a_list});
Expect.isTrue({a, ...?a_list} is Set<A>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
+ Expect.runtimeIsType<Set<A>>({a, ...?a_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
Expect.isTrue({...b_list} is Set<A>);
+ Expect.runtimeIsType<Set<A>>({...b_list});
Expect.isTrue({a, ...?b_list} is Set<A>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
+ Expect.runtimeIsType<Set<A>>({a, ...?b_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
Expect.isTrue({...c_list} is Set<A>);
+ Expect.runtimeIsType<Set<A>>({...c_list});
Expect.isTrue({a, ...?c_list} is Set<A>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<Set<A>>({a, ...?c_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isTrue({a, ...a_list, ...b_list, b} is Set<A>);
+ Expect.runtimeIsType<Set<A>>({a, ...a_list, ...b_list, b});
Expect.isTrue({a, b, c, ...a_list, ...b_list, ...?c_list} is Set<A>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<Set<A>>({a, b, c, ...a_list, ...b_list, ...?c_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isTrue({a, ...a_list, ...b_list, b} is Set<A>);
+ Expect.runtimeIsType<Set<A>>({a, ...a_list, ...b_list, b});
Expect.isFalse({...a_list} is Set<B>);
+ Expect.runtimeIsNotType<Set<B>>({...a_list});
Expect.isFalse({b, ...?a_list} is Set<B>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
+ Expect.runtimeIsNotType<Set<B>>({b, ...?a_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
Expect.isTrue({...b_list} is Set<B>);
+ Expect.runtimeIsType<Set<B>>({...b_list});
Expect.isTrue({b, ...?b_list} is Set<B>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
+ Expect.runtimeIsType<Set<B>>({...?b_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
Expect.isTrue({...c_list} is Set<B>);
+ Expect.runtimeIsType<Set<B>>({...c_list});
Expect.isTrue({b, ...?c_list} is Set<B>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<Set<B>>({...?c_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isFalse({c, ...a_list, ...b_list, b} is Set<B>);
+ Expect.runtimeIsNotType<Set<B>>({c, ...a_list, ...b_list, b});
Expect.isFalse({b, c, ...a_list, ...b_list, ...?c_list} is Set<B>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsNotType<Set<B>>({b, c, ...a_list, ...b_list, ...?c_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null
Expect.isTrue({b, ...c_list, ...b_list, b} is Set<B>);
+ Expect.runtimeIsType<Set<B>>({b, ...c_list, ...b_list, b});
Expect.isFalse({...a_list} is Set<C>);
+ Expect.runtimeIsNotType<Set<C>>({...a_list});
Expect.isFalse({c, ...?a_list} is Set<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
+ Expect.runtimeIsNotType<Set<C>>({c, ...?a_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<A>' which excludes null.
Expect.isFalse({...b_list} is Set<C>);
+ Expect.runtimeIsNotType<Set<C>>({c, ...b_list});
Expect.isFalse({c, ...?b_list} is Set<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
+ Expect.runtimeIsNotType<Set<C>>({c, ...?b_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<B>' which excludes null.
Expect.isTrue({...c_list} is Set<C>);
+ Expect.runtimeIsType<Set<C>>({...c_list});
Expect.isTrue({...?c_list} is Set<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<Set<C>>({...?c_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isTrue({c, ...?c_list} is Set<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsType<Set<C>>({c, ...?c_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isFalse({c, ...a_list, ...b_list, c} is Set<C>);
+ Expect.runtimeIsNotType<Set<C>>({c, ...a_list, ...b_list, c});
Expect.isFalse({c, ...a_list, ...b_list, ...?c_list} is Set<C>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
+ Expect.runtimeIsNotType<Set<C>>({c, ...a_list, ...b_list, ...?c_list});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'List<C>' which excludes null.
Expect.isFalse({a, ...c_list, ...b_list, b} is Set<C>);
+ Expect.runtimeIsNotType<Set<C>>({a, ...c_list, ...b_list, b});
}
diff --git a/LanguageFeatures/Spread-collections/TypeInference_A03_t01.dart b/LanguageFeatures/Spread-collections/TypeInference_A03_t01.dart
index 98f7cde..50146aa 100644
--- a/LanguageFeatures/Spread-collections/TypeInference_A03_t01.dart
+++ b/LanguageFeatures/Spread-collections/TypeInference_A03_t01.dart
@@ -32,28 +32,35 @@
Map map1 = <int, int>{2: 4, 7: 16, ...int_map, 4: 40};
Expect.isTrue(map1 is Map<int, int>);
+ Expect.runtimeIsType<Map<int, int>>(map1);
Map map2 = <A1, A2>{new A1(): new A2(), ...?a_map};
Expect.isTrue(map2 is Map<A1, A2>);
+ Expect.runtimeIsType<Map<A1, A2>>(map2);
Map map3 = <A1, A2>{new A1(): new A2(), ...b_map};
Expect.isTrue(map3 is Map<A1, A2>);
+ Expect.runtimeIsType<Map<A1, A2>>(map3);
Map map4 = <A1, A2>{new A1(): new A2(), ...c_map, new B1(): new C2()};
Expect.isTrue(map4 is Map<A1, A2>);
+ Expect.runtimeIsType<Map<A1, A2>>(map4);
Map map5 = <A1, A2>{new A1(): new B2(), new B1(): new C2(),
new C1(): new C2(), ...?c_map, new B1(): new A2(), ...a_map, ...b_map,
new A1(): new C2()};
Expect.isTrue(map5 is Map<A1, A2>);
+ Expect.runtimeIsType<Map<A1, A2>>(map5);
Map map6 = <B1, B2>{new B1(): new B2(), ...?b_map, new C1(): new C2(),
...c_map};
Expect.isTrue(map6 is Map<B1, B2>);
+ Expect.runtimeIsType<Map<B1, B2>>(map6);
Map map7 = {123: 14, "123": "1", new A1(): null, new A2(): new C1(), ...a_map,
...?b_map, 148: new C1(), ...?c_map, ...int_map, 1499: null, -7: []};
Expect.isTrue(map7 is Map<Object?, Object?>);
+ Expect.runtimeIsType<Map<Object?, Object?>>(map7);
Map map8;
Expect.throws(() => map8 = <int, int>{...str_map});
diff --git a/LanguageFeatures/Spread-collections/TypeInference_A04_t01.dart b/LanguageFeatures/Spread-collections/TypeInference_A04_t01.dart
index f1ff91a..3b04588 100644
--- a/LanguageFeatures/Spread-collections/TypeInference_A04_t01.dart
+++ b/LanguageFeatures/Spread-collections/TypeInference_A04_t01.dart
@@ -38,63 +38,121 @@
C2 c2 = new C2();
Expect.isTrue({...int_map} is Map<int, int>);
+ Expect.runtimeIsType<Map<int, int>>({...int_map});
Expect.isTrue({1: "test", 2: "a", ...?str_map, 3: "oo"} is Map<int, String>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<int, String>' which excludes null.
+ Expect.runtimeIsType<Map<int, String>>({1: "test", 2: "a", ...?str_map, 3: "oo"});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<int, String>' which excludes null.
Expect.isTrue({...a_map} is Map<A1, A2>);
+ Expect.runtimeIsType<Map<A1, A2>>({...a_map});
Expect.isTrue({a1: a2, ...?a_map} is Map<A1, A2>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<A1, A2>' which excludes null.
+ Expect.runtimeIsType<Map<A1, A2>>({a1: a2, ...?a_map});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<A1, A2>' which excludes null.
Expect.isTrue({...b_map} is Map<A1, A2>);
+ Expect.runtimeIsType<Map<A1, A2>>({...b_map});
Expect.isTrue({a1: a2, ...?b_map} is Map<A1, A2>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<B1, B2>' which excludes null.
+ Expect.runtimeIsType<Map<A1, A2>>({a1: a2, ...?b_map});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<B1, B2>' which excludes null.
Expect.isTrue({...c_map} is Map<A1, A2>);
+ Expect.runtimeIsType<Map<A1, A2>>({...c_map});
Expect.isTrue({a1: a2, ...?c_map} is Map<A1, A2>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<C1, C2>' which excludes null.
+ Expect.runtimeIsType<Map<A1, A2>>({a1: a2, ...?c_map});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<C1, C2>' which excludes null.
Expect.isTrue({a1: a2, ...a_map, ...b_map, b1: b2} is Map<A1, A2>);
+ Expect.runtimeIsType<Map<A1, A2>>({a1: a2, ...a_map, ...b_map, b1: b2} );
Expect.isTrue(
{a1: a2, b1: b2, c1: c2, ...a_map, ...?b_map, ...c_map} is Map<A1, A2>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<B1, B2>' which excludes null.
+ Expect.runtimeIsType<Map<A1, A2>>(
+ {a1: a2, b1: b2, c1: c2, ...a_map, ...?b_map, ...c_map});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<B1, B2>' which excludes null.
Expect.isTrue({a1: a2, ...a_map, ...b_map, b1: b2} is Map<A1, A2>);
+ Expect.runtimeIsType<Map<A1, A2>>({a1: a2, ...a_map, ...b_map, b1: b2});
Expect.isFalse({...a_map} is Map<B1, B2>);
+ Expect.runtimeIsNotType<Map<B1, B2>>({...a_map});
Expect.isFalse({b1: b2, ...?a_map} is Map<B1, B2>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<A1, A2>' which excludes null.
+ Expect.runtimeIsNotType<Map<B1, B2>>({b1: b2, ...?a_map});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<A1, A2>' which excludes null.
Expect.isTrue({...b_map} is Map<B1, B2>);
+ Expect.runtimeIsType<Map<B1, B2>>({...b_map});
Expect.isTrue({b1: b2, ...?b_map} is Map<B1, B2>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<B1, B2>' which excludes null.
+ Expect.runtimeIsType<Map<B1, B2>>({b1: b2, ...?b_map});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<B1, B2>' which excludes null.
Expect.isTrue({...c_map} is Map<B1, B2>);
+ Expect.runtimeIsType<Map<B1, B2>>({...c_map});
Expect.isTrue({b1: b2, ...?c_map} is Map<B1, B2>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<C1, C2>' which excludes null.
+ Expect.runtimeIsType<Map<B1, B2>>({b1: b2, ...?c_map});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<C1, C2>' which excludes null.
Expect.isFalse({c1: c2, ...a_map, ...b_map, b1: b2} is Map<B1, B2>);
+ Expect.runtimeIsNotType<Map<B1, B2>>({c1: c2, ...a_map, ...b_map, b1: b2});
Expect.isFalse(
{b1: b2, c1: c2, ...a_map, ...b_map, ...?c_map} is Map<B1, B2>);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<C1, C2>' which excludes null.
+ Expect.runtimeIsNotType<Map<B1, B2>>(
+ {b1: b2, c1: c2, ...a_map, ...b_map, ...?c_map});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<C1, C2>' which excludes null.
Expect.isFalse({a1: a2, ...c_map, ...b_map, b1: b2} is Map<B1, B2>);
+ Expect.runtimeIsNotType<Map<B1, B2>>({a1: a2, ...c_map, ...b_map, b1: b2});
}
diff --git a/LanguageFeatures/Spread-collections/TypeInference_A05_t05.dart b/LanguageFeatures/Spread-collections/TypeInference_A05_t05.dart
index d6f127b..a198af4 100644
--- a/LanguageFeatures/Spread-collections/TypeInference_A05_t05.dart
+++ b/LanguageFeatures/Spread-collections/TypeInference_A05_t05.dart
@@ -30,5 +30,7 @@
Expect.throws(() => res = {...set, ...m});
Expect.isTrue({...map, ...m} is Map);
+ Expect.runtimeIsType<Map>({...map, ...m});
Expect.isTrue({...m, ...map} is Map);
+ Expect.runtimeIsType<Map>({...m, ...map});
}
diff --git a/LanguageFeatures/Spread-collections/TypeInference_A05_t06.dart b/LanguageFeatures/Spread-collections/TypeInference_A05_t06.dart
index 2360a25..a448e4c 100644
--- a/LanguageFeatures/Spread-collections/TypeInference_A05_t06.dart
+++ b/LanguageFeatures/Spread-collections/TypeInference_A05_t06.dart
@@ -47,22 +47,39 @@
// [cfe] Operand of null-aware operation '...?' has type 'Map<dynamic, dynamic>' which excludes null.
Expect.isTrue({...?map, ...m} is Map);
+ Expect.runtimeIsType<Map>({...?map, ...m});
Expect.isTrue({...m, ...?map} is Map);
+ Expect.runtimeIsType<Map>({...m, ...?map});
Expect.isTrue({...map, ...?m} is Map);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<dynamic, dynamic>' which excludes null.
+ Expect.runtimeIsType<Map>({...map, ...?m});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<dynamic, dynamic>' which excludes null.
Expect.isTrue({...?m, ...map} is Map);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<dynamic, dynamic>' which excludes null.
+ Expect.runtimeIsType<Map>({...?m, ...map});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<dynamic, dynamic>' which excludes null.
Expect.isTrue({...?map, ...?m} is Map);
// ^^^^
// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
// ^
// [cfe] Operand of null-aware operation '...?' has type 'Map<dynamic, dynamic>' which excludes null.
+ Expect.runtimeIsType<Map>({...?map, ...?m});
+// ^^^^
+// [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR
+// ^
+// [cfe] Operand of null-aware operation '...?' has type 'Map<dynamic, dynamic>' which excludes null.
}