#1243 Runtime checks added for statements which can be optimized to 'true' or 'false'
diff --git a/Language/Generics/parameter_A04_t04.dart b/Language/Generics/parameter_A04_t04.dart
index 6e89390..a44ca0a 100644
--- a/Language/Generics/parameter_A04_t04.dart
+++ b/Language/Generics/parameter_A04_t04.dart
@@ -13,7 +13,6 @@
/// scope.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class A {}
@@ -26,12 +25,20 @@
main() {
Expect.isTrue(testme1 is Test);
+ checkType(checkIs<Test>, true, testme1);
Expect.isTrue(testme1 is Test<A, A>);
+ checkType(checkIs<Test<A, A>>, true, testme1);
Expect.isTrue(testme1 is Test<A, B>);
+ checkType(checkIs<Test<A, B>>, true, testme1);
Expect.isTrue(testme1 is Test<B, B>);
+ checkType(checkIs<Test<B, B>>, true, testme1);
Expect.isFalse(testme2 is Test);
+ checkType(checkIs<Test>, false, testme2);
Expect.isFalse(testme2 is Test<A, A>);
+ checkType(checkIs<Test<A, A>>, false, testme2);
Expect.isFalse(testme2 is Test<A, B>);
+ checkType(checkIs<Test<A, B>>, false, testme2);
Expect.isTrue(testme2 is Test<B, B>);
+ checkType(checkIs<Test<B, B>>, true, testme2);
}
diff --git a/Language/Generics/parameter_A05_t02.dart b/Language/Generics/parameter_A05_t02.dart
index 21c97f8..41e46ca 100644
--- a/Language/Generics/parameter_A05_t02.dart
+++ b/Language/Generics/parameter_A05_t02.dart
@@ -14,7 +14,6 @@
/// [implements] clause.
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class A {}
@@ -25,14 +24,23 @@
main() {
Expect.isTrue(D() is C);
+ checkType(checkIs<C>, true, D());
Expect.isTrue(D() is C<A>);
+ checkType(checkIs<C<A>>, true, D());
Expect.isFalse(D() is C<B>);
+ checkType(checkIs<C<B>>, false, D());
Expect.isTrue(D<A>() is C);
+ checkType(checkIs<C>, true, D<A>());
Expect.isTrue(D<A>() is C<A>);
+ checkType(checkIs<C<A>>, true, D<A>());
Expect.isFalse(D<A>() is C<B>);
+ checkType(checkIs<C<B>>, false, D<A>());
Expect.isTrue(D<B>() is C);
+ checkType(checkIs<C>, true, D<B>());
Expect.isTrue(D<B>() is C<A>);
+ checkType(checkIs<C<A>>, true, D<B>());
Expect.isTrue(D<B>() is C<B>);
+ checkType(checkIs<C<B>>, true, D<B>());
}
diff --git a/Language/Generics/scope_t03.dart b/Language/Generics/scope_t03.dart
index 0907ce0..d468214 100644
--- a/Language/Generics/scope_t03.dart
+++ b/Language/Generics/scope_t03.dart
@@ -11,7 +11,6 @@
/// @Issue 29388
/// @author iefremov
-
import "../../Utils/expect.dart";
class A<N, S, U> {
@@ -20,13 +19,16 @@
A(N n, S s) : field = <U>[] {
Expect.isTrue(n is N);
+ checkType(checkIs<N>, true, n);
Expect.isTrue(s is S);
+ checkType(checkIs<S>, true, s);
}
A.empty() : field = null{}
factory A.f(S s) {
Expect.isTrue(s is S);
+ checkType(checkIs<S>, true, s);
return new A.empty();
}
@@ -43,7 +45,6 @@
abstract class I<H, C, K> extends J<C, K> {}
-
main() {
new A<num, double, List>(1, 2.0);
A a = new A<int, int, int>.f(1);
diff --git a/Language/Generics/syntax_t20.dart b/Language/Generics/syntax_t20.dart
index 7f45a4f..3218708 100644
--- a/Language/Generics/syntax_t20.dart
+++ b/Language/Generics/syntax_t20.dart
@@ -20,16 +20,21 @@
AAlias a1 = new A(12345);
Expect.isTrue(a1 is A);
Expect.isTrue(a1 is AAlias);
+ checkType(checkIs<A>, true, a1);
+ checkType(checkIs<AAlias>, true, a1);
Expect.equals(12345, a1.val);
AAlias<int> a2 = new A<int>(14);
Expect.isTrue(a2 is A<int>);
Expect.isTrue(a2 is AAlias<int>);
+ checkType(checkIs<A<int>>, true, a2);
+ checkType(checkIs<AAlias<int>>, true, a2);
Expect.equals(14, a2.val);
AAlias<List<num>> a3 = new A<List<num>>([]);
Expect.isTrue(a3 is A<List<num>>);
Expect.isTrue(a3 is AAlias<List<num>>);
+ checkType(checkIs<A<List<num>>>, true, a3);
+ checkType(checkIs<AAlias<List<num>>>, true, a3);
Expect.listEquals([], a3.val);
-
}
diff --git a/Language/Generics/syntax_t22.dart b/Language/Generics/syntax_t22.dart
index 810da9f..e88ff9f 100644
--- a/Language/Generics/syntax_t22.dart
+++ b/Language/Generics/syntax_t22.dart
@@ -21,12 +21,16 @@
BAlias b1 = new B(1, 2);
Expect.isTrue(b1 is B);
Expect.isTrue(b1 is BAlias);
+ checkType(checkIs<B>, true, b1);
+ checkType(checkIs<BAlias>, true, b1);
Expect.equals(1, b1.x);
Expect.equals(2, b1.y);
BAlias<int, String> b2 = new B<int, String>(0, "testme");
Expect.isTrue(b2 is B<int, String>);
Expect.isTrue(b2 is BAlias<int, String>);
+ checkType(checkIs<B<int, String>>, true, b2);
+ checkType(checkIs<BAlias<int, String>>, true, b2);
Expect.equals(0, b2.x);
Expect.equals("testme", b2.y);
}
diff --git a/Language/Generics/syntax_t23.dart b/Language/Generics/syntax_t23.dart
index d8f00e3..87fb304 100644
--- a/Language/Generics/syntax_t23.dart
+++ b/Language/Generics/syntax_t23.dart
@@ -26,12 +26,16 @@
BAlias b1 = B(1, 2);
Expect.isTrue(b1 is B);
Expect.isTrue(b1 is BAlias);
+ checkType(checkIs<B>, true, b1);
+ checkType(checkIs<BAlias>, true, b1);
Expect.equals(1, b1.x);
Expect.equals(2, b1.y);
BAlias<int> b2 = new B<int, int>(0, 100);
Expect.isTrue(b2 is B<int, int>);
Expect.isTrue(b2 is BAlias<int>);
+ checkType(checkIs<B<int, int>>, true, b2);
+ checkType(checkIs<BAlias<int>>, true, b2);
Expect.equals(0, b2.x);
Expect.equals(100, b2.y);
@@ -39,6 +43,8 @@
BAlias<A<int?>?> b3 = new B<A<int?>?, A<int?>?>(a, null);
Expect.isTrue(b3 is B<A<int?>?, A<int?>?>);
Expect.isTrue(b3 is BAlias<A<int?>?>);
+ checkType(checkIs<B<A<int?>?, A<int?>?>>, true, b3);
+ checkType(checkIs<BAlias<A<int?>?>>, true, b3);
Expect.equals(a, b3.x);
Expect.isNull(b3.y);
}
diff --git a/Language/Generics/syntax_t24.dart b/Language/Generics/syntax_t24.dart
index d5a0fd1..3b0ab8b 100644
--- a/Language/Generics/syntax_t24.dart
+++ b/Language/Generics/syntax_t24.dart
@@ -21,6 +21,8 @@
BAlias b1 = new B(1, "2");
Expect.isTrue(b1 is B);
Expect.isTrue(b1 is BAlias);
+ checkType(checkIs<B>, true, b1);
+ checkType(checkIs<BAlias>, true, b1);
Expect.isTrue(b1 is BAlias<num, String>);
Expect.equals(1, b1.x);
Expect.equals("2", b1.y);
@@ -28,6 +30,8 @@
BAlias<int, String> b2 = new B<int, String>(0, "testme");
Expect.isTrue(b2 is B<int, String>);
Expect.isTrue(b2 is BAlias<int, String>);
+ checkType(checkIs<B<int, String>>, true, b2);
+ checkType(checkIs<BAlias<int, String>>, true, b2);
Expect.equals(0, b2.x);
Expect.equals("testme", b2.y);
}
diff --git a/Language/Generics/syntax_t25.dart b/Language/Generics/syntax_t25.dart
index 7210416..7b3b035 100644
--- a/Language/Generics/syntax_t25.dart
+++ b/Language/Generics/syntax_t25.dart
@@ -22,10 +22,15 @@
Expect.isTrue(b1 is B<dynamic, dynamic>);
Expect.isTrue(b1 is BAlias);
Expect.isTrue(b1 is BAlias<dynamic, dynamic>);
+ checkType(checkIs<B<dynamic, dynamic>>, true, b1);
+ checkType(checkIs<BAlias>, true, b1);
+ checkType(checkIs<BAlias<dynamic, dynamic>>, true, b1);
BAlias<num, int> b2 = new B<num, int>(0, 149);
Expect.isTrue(b2 is B<num, int>);
Expect.isTrue(b2 is BAlias<num, int>);
+ checkType(checkIs<B<num, int>>, true, b2);
+ checkType(checkIs<BAlias<num, int>>, true, b2);
Expect.equals(0, b2.x);
Expect.equals(149, b2.y);
diff --git a/Language/Generics/typedef_A01_t01.dart b/Language/Generics/typedef_A01_t01.dart
index 605a7d6..b950718 100644
--- a/Language/Generics/typedef_A01_t01.dart
+++ b/Language/Generics/typedef_A01_t01.dart
@@ -30,10 +30,13 @@
main() {
CAlias ca1 = new CAlias();
Expect.isTrue(ca1 is C<num>);
+ checkType(checkIs<C<num>>, true, ca1);
CAlias<int> ca2 = new CAlias<int>();
Expect.isTrue(ca2 is C<int>);
+ checkType(checkIs<C<int>>, true, ca2);
DAlias da = new DAlias();
Expect.isTrue(da is D<num, String>);
+ checkType(checkIs<D<num, String>>, true, da);
}
diff --git a/Language/Generics/typedef_A04_t03.dart b/Language/Generics/typedef_A04_t03.dart
index eab0893..126a3b7 100644
--- a/Language/Generics/typedef_A04_t03.dart
+++ b/Language/Generics/typedef_A04_t03.dart
@@ -29,11 +29,19 @@
Expect.isTrue(checkme2 is Func1);
Expect.isTrue(checkme3 is Func1);
Expect.isTrue(checkme4 is Func1);
+ checkType(checkIs<Func1>, true, checkme1);
+ checkType(checkIs<Func1>, true, checkme2);
+ checkType(checkIs<Func1>, true, checkme3);
+ checkType(checkIs<Func1>, true, checkme4);
Expect.isFalse(checkme1 is Func2);
Expect.isFalse(checkme2 is Func2);
+ checkType(checkIs<Func2>, false, checkme1);
+ checkType(checkIs<Func2>, false, checkme2);
if (hasSoundNullSafety) {
Expect.isFalse(checkme3 is Func2);
Expect.isFalse(checkme4 is Func2);
+ checkType(checkIs<Func2>, false, checkme3);
+ checkType(checkIs<Func2>, false, checkme4);
}
}
diff --git a/Language/Generics/typedef_A04_t04.dart b/Language/Generics/typedef_A04_t04.dart
index 228f421..c264854 100644
--- a/Language/Generics/typedef_A04_t04.dart
+++ b/Language/Generics/typedef_A04_t04.dart
@@ -11,7 +11,6 @@
/// some function
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class X {}
@@ -33,16 +32,31 @@
Expect.isFalse(checkme3 is Func1);
Expect.isFalse(checkme4 is Func1);
Expect.isFalse(checkme5 is Func1);
+ checkType(checkIs<Func1>, true, checkme1);
+ checkType(checkIs<Func1>, false, checkme2);
+ checkType(checkIs<Func1>, false, checkme3);
+ checkType(checkIs<Func1>, false, checkme4);
+ checkType(checkIs<Func1>, false, checkme5);
Expect.isTrue (checkme1 is Func2);
Expect.isFalse(checkme2 is Func2);
Expect.isFalse(checkme3 is Func2);
Expect.isTrue (checkme4 is Func2);
Expect.isFalse(checkme5 is Func2);
+ checkType(checkIs<Func2>, true, checkme1);
+ checkType(checkIs<Func2>, false, checkme2);
+ checkType(checkIs<Func2>, false, checkme3);
+ checkType(checkIs<Func2>, true, checkme4);
+ checkType(checkIs<Func2>, false, checkme5);
Expect.isTrue (checkme1 is Func3);
Expect.isFalse(checkme2 is Func3);
Expect.isFalse(checkme3 is Func3);
Expect.isTrue (checkme4 is Func3);
Expect.isTrue (checkme5 is Func3);
+ checkType(checkIs<Func3>, true, checkme1);
+ checkType(checkIs<Func3>, false, checkme2);
+ checkType(checkIs<Func3>, false, checkme3);
+ checkType(checkIs<Func3>, true, checkme4);
+ checkType(checkIs<Func3>, true, checkme5);
}
diff --git a/Language/Generics/typedef_A04_t05.dart b/Language/Generics/typedef_A04_t05.dart
index b6917df..98a685e 100644
--- a/Language/Generics/typedef_A04_t05.dart
+++ b/Language/Generics/typedef_A04_t05.dart
@@ -11,7 +11,6 @@
/// some function
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class X {}
@@ -33,16 +32,32 @@
Expect.isFalse(checkme3 is Func1);
Expect.isFalse(checkme4 is Func1);
Expect.isFalse(checkme5 is Func1);
+ checkType(checkIs<Func1>, true, checkme1);
+ checkType(checkIs<Func1>, false, checkme2);
+ checkType(checkIs<Func1>, false, checkme3);
+ checkType(checkIs<Func1>, false, checkme4);
+ checkType(checkIs<Func1>, false, checkme5);
Expect.isFalse(checkme1 is Func2);
Expect.isFalse(checkme2 is Func2);
Expect.isFalse (checkme3 is Func2);
Expect.isTrue (checkme4 is Func2);
Expect.isFalse (checkme5 is Func2);
+ checkType(checkIs<Func2>, true, checkme1);
+ checkType(checkIs<Func2>, false, checkme2);
+ checkType(checkIs<Func2>, false, checkme3);
+ checkType(checkIs<Func2>, true, checkme4);
+ checkType(checkIs<Func2>, false, checkme5);
Expect.isFalse(checkme1 is Func3);
Expect.isFalse(checkme2 is Func3);
Expect.isFalse (checkme3 is Func3);
Expect.isFalse (checkme4 is Func3);
Expect.isTrue (checkme5 is Func3);
+ checkType(checkIs<Func3>, false, checkme1);
+ checkType(checkIs<Func3>, false, checkme2);
+ checkType(checkIs<Func3>, false, checkme3);
+ checkType(checkIs<Func3>, false, checkme4);
+ checkType(checkIs<Func3>, true, checkme5);
+
}
diff --git a/Language/Generics/typedef_A04_t06.dart b/Language/Generics/typedef_A04_t06.dart
index 17811bf..81a8f23 100644
--- a/Language/Generics/typedef_A04_t06.dart
+++ b/Language/Generics/typedef_A04_t06.dart
@@ -11,7 +11,6 @@
/// some function
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class X {}
@@ -29,12 +28,21 @@
Expect.isTrue(checkme1 is Func1);
Expect.isFalse(checkme1 is Func2);
Expect.isFalse(checkme1 is Func3);
+ checkType(checkIs<Func1>, true, checkme1);
+ checkType(checkIs<Func2>, false, checkme1);
+ checkType(checkIs<Func3>, false, checkme1);
Expect.isFalse(checkme2 is Func1);
Expect.isTrue(checkme2 is Func2);
Expect.isFalse(checkme2 is Func3);
+ checkType(checkIs<Func1>, false, checkme2);
+ checkType(checkIs<Func2>, true, checkme2);
+ checkType(checkIs<Func3>, false, checkme2);
Expect.isFalse(checkme3 is Func1);
Expect.isFalse(checkme3 is Func2);
Expect.isTrue(checkme3 is Func3);
+ checkType(checkIs<Func1>, false, checkme3);
+ checkType(checkIs<Func2>, false, checkme3);
+ checkType(checkIs<Func3>, true, checkme3);
}
diff --git a/Language/Generics/typedef_A04_t07.dart b/Language/Generics/typedef_A04_t07.dart
index 2894829..6a8efbf 100644
--- a/Language/Generics/typedef_A04_t07.dart
+++ b/Language/Generics/typedef_A04_t07.dart
@@ -11,7 +11,6 @@
/// some function
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class X {}
@@ -29,13 +28,23 @@
Expect.isTrue(checkme1 is Func1);
Expect.isFalse(checkme1 is Func2);
Expect.isFalse(checkme1 is Func3);
+ checkType(checkIs<Func1>, true, checkme1);
+ checkType(checkIs<Func2>, false, checkme1);
+ checkType(checkIs<Func3>, false, checkme1);
Expect.isFalse(checkme2 is Func1);
Expect.isTrue(checkme2 is Func2);
Expect.isFalse(checkme2 is Func3);
+ checkType(checkIs<Func1>, false, checkme2);
+ checkType(checkIs<Func2>, true, checkme2);
+ checkType(checkIs<Func3>, false, checkme2);
Expect.isFalse(checkme3 is Func1);
Expect.isFalse(checkme3 is Func2);
Expect.isTrue(checkme3 is Func3);
Expect.isTrue(checkme3 is Func2<Y>);
+ checkType(checkIs<Func1>, false, checkme3);
+ checkType(checkIs<Func2>, false, checkme3);
+ checkType(checkIs<Func3>, true, checkme3);
+ checkType(checkIs<Func2<Y>>, true, checkme3);
}
diff --git a/Language/Generics/typedef_A04_t08.dart b/Language/Generics/typedef_A04_t08.dart
index a81d058..c4c43e5 100644
--- a/Language/Generics/typedef_A04_t08.dart
+++ b/Language/Generics/typedef_A04_t08.dart
@@ -11,7 +11,6 @@
/// some function
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class X {}
@@ -33,16 +32,31 @@
Expect.isFalse(checkme3 is Func1);
Expect.isFalse(checkme4 is Func1);
Expect.isFalse(checkme5 is Func1);
+ checkType(checkIs<Func1>, true, checkme1);
+ checkType(checkIs<Func1>, false, checkme2);
+ checkType(checkIs<Func1>, false, checkme3);
+ checkType(checkIs<Func1>, false, checkme4);
+ checkType(checkIs<Func1>, false, checkme5);
Expect.isTrue (checkme1 is Func2);
Expect.isFalse(checkme2 is Func2);
Expect.isFalse(checkme3 is Func2);
Expect.isTrue (checkme4 is Func2);
Expect.isFalse(checkme5 is Func2);
+ checkType(checkIs<Func2>, true, checkme1);
+ checkType(checkIs<Func2>, false, checkme2);
+ checkType(checkIs<Func2>, false, checkme3);
+ checkType(checkIs<Func2>, true, checkme4);
+ checkType(checkIs<Func2>, false, checkme5);
Expect.isTrue (checkme1 is Func3);
Expect.isFalse(checkme2 is Func3);
Expect.isFalse(checkme3 is Func3);
Expect.isTrue (checkme4 is Func3);
Expect.isTrue (checkme5 is Func3);
+ checkType(checkIs<Func3>, true, checkme1);
+ checkType(checkIs<Func3>, false, checkme2);
+ checkType(checkIs<Func3>, false, checkme3);
+ checkType(checkIs<Func3>, true, checkme4);
+ checkType(checkIs<Func3>, true, checkme5);
}
diff --git a/Language/Generics/typedef_A04_t09.dart b/Language/Generics/typedef_A04_t09.dart
index 9f0a9af..63b94d9 100644
--- a/Language/Generics/typedef_A04_t09.dart
+++ b/Language/Generics/typedef_A04_t09.dart
@@ -11,7 +11,6 @@
/// some function
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class X {}
@@ -33,16 +32,31 @@
Expect.isFalse(checkme3 is Func1);
Expect.isFalse(checkme4 is Func1);
Expect.isFalse(checkme5 is Func1);
+ checkType(checkIs<Func1>, true, checkme1);
+ checkType(checkIs<Func1>, false, checkme2);
+ checkType(checkIs<Func1>, false, checkme3);
+ checkType(checkIs<Func1>, false, checkme4);
+ checkType(checkIs<Func1>, false, checkme5);
Expect.isTrue (checkme1 is Func2);
Expect.isFalse(checkme2 is Func2);
Expect.isFalse(checkme3 is Func2);
Expect.isTrue (checkme4 is Func2);
Expect.isFalse(checkme5 is Func2);
+ checkType(checkIs<Func2>, true, checkme1);
+ checkType(checkIs<Func2>, false, checkme2);
+ checkType(checkIs<Func2>, false, checkme3);
+ checkType(checkIs<Func2>, true, checkme4);
+ checkType(checkIs<Func2>, false, checkme5);
Expect.isTrue (checkme1 is Func3);
Expect.isFalse(checkme2 is Func3);
Expect.isFalse(checkme3 is Func3);
Expect.isTrue (checkme4 is Func3);
Expect.isTrue (checkme5 is Func3);
+ checkType(checkIs<Func3>, true, checkme1);
+ checkType(checkIs<Func3>, false, checkme2);
+ checkType(checkIs<Func3>, false, checkme3);
+ checkType(checkIs<Func3>, true, checkme4);
+ checkType(checkIs<Func3>, true, checkme5);
}
diff --git a/Language/Generics/typedef_A05_t01.dart b/Language/Generics/typedef_A05_t01.dart
index abea70b..ea3c33f 100644
--- a/Language/Generics/typedef_A05_t01.dart
+++ b/Language/Generics/typedef_A05_t01.dart
@@ -11,7 +11,6 @@
/// @description Checks that [D] maps argument list to types
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class X {}
diff --git a/Language/Generics/typedef_A05_t02.dart b/Language/Generics/typedef_A05_t02.dart
index 2c3d560..ebf7e80 100644
--- a/Language/Generics/typedef_A05_t02.dart
+++ b/Language/Generics/typedef_A05_t02.dart
@@ -11,7 +11,6 @@
/// @description Checks that [D] maps argument list to types
/// @author iarkh@unipro.ru
-
import "../../Utils/expect.dart";
class X {}
@@ -42,20 +41,25 @@
Test1 t2 = checkme2;
X x2 = t2(X, X());
Expect.isTrue(t2(X, x2) is X);
+ checkType(checkIs<X>, true, t2(X, x2));
Test1 t3 = checkme3;
Y y3 = t3(Y, Y());
Expect.isTrue(t3(Y, Y()) is Y);
+ checkType(checkIs<Y>, true, t3(Y, Y()));
Test2 t4 = checkme2;
X x4 = t4(X, X());
Expect.isTrue(t4(X, x4) is X);
+ checkType(checkIs<X>, true, t4(X, x4));
Test2 t5 = checkme3;
X y5 = t5(Y, Y());
Expect.isTrue(t5(Y, y5) is Y);
+ checkType(checkIs<Y>, true, t5(Y, y5));
Test2 t6 = checkme2;
X x6 = t6(X, X());
Expect.isTrue(t6(X, x6) is X);
+ checkType(checkIs<X>, true, t6(X, x6));
}
diff --git a/Language/Libraries_and_Scripts/Exports/reexport__itself_t02.dart b/Language/Libraries_and_Scripts/Exports/reexport__itself_t02.dart
index 29619ff..771e569 100644
--- a/Language/Libraries_and_Scripts/Exports/reexport__itself_t02.dart
+++ b/Language/Libraries_and_Scripts/Exports/reexport__itself_t02.dart
@@ -11,11 +11,11 @@
/// declarations prevent second copies of them from being added to the export
/// namespace via an explicit export declaration so there's no ambiguity.
/// @author rodionov
-/// @reviewer kaigorodov
-
+import "../../../Utils/expect.dart";
import "reexport__itself_t02_lib.dart";
main() {
- () {} is foo;
+ Expect.isTrue(() {} is foo);
+ checkType(checkIs<foo>, true, () {});
}
diff --git a/Language/Libraries_and_Scripts/Imports/deferred_import_t01.dart b/Language/Libraries_and_Scripts/Imports/deferred_import_t01.dart
index fe6f230..2dfc83f 100644
--- a/Language/Libraries_and_Scripts/Imports/deferred_import_t01.dart
+++ b/Language/Libraries_and_Scripts/Imports/deferred_import_t01.dart
@@ -70,4 +70,5 @@
Expect.throws(() { p.Func; }, (e) => e is NoSuchMethodError);
Expect.isTrue(p.loadLibrary() is Future);
+ checkType(checkIs<Future>, true, p.loadLibrary());
}
diff --git a/Language/Libraries_and_Scripts/Imports/deferred_import_t02.dart b/Language/Libraries_and_Scripts/Imports/deferred_import_t02.dart
index bfe468c..85f22c1 100644
--- a/Language/Libraries_and_Scripts/Imports/deferred_import_t02.dart
+++ b/Language/Libraries_and_Scripts/Imports/deferred_import_t02.dart
@@ -66,6 +66,7 @@
p.someSetter = 1;
p.Func;
Expect.isTrue(p.loadLibrary() is Future);
+ checkType(checkIs<Future>, true, p.loadLibrary());
}
main() {
diff --git a/Language/Libraries_and_Scripts/Imports/namespace_changes_t09.dart b/Language/Libraries_and_Scripts/Imports/namespace_changes_t09.dart
index f4c614a..342f759 100644
--- a/Language/Libraries_and_Scripts/Imports/namespace_changes_t09.dart
+++ b/Language/Libraries_and_Scripts/Imports/namespace_changes_t09.dart
@@ -61,17 +61,17 @@
/// @author vasya
import "../../../Utils/expect.dart";
-
import "namespace_changes_t09_lib.dart";
var foo = 1;
bar() {}
-class Fwah {}
-class Duh extends Fwah {}
+class A {}
+class C extends A {}
main() {
Expect.equals(1, foo);
Expect.isTrue(bar is Function);
- new Fwah();
+ checkType(checkIs<Function>, true, bar);
+ new C();
}
diff --git a/Language/Libraries_and_Scripts/Imports/namespace_changes_t09_lib.dart b/Language/Libraries_and_Scripts/Imports/namespace_changes_t09_lib.dart
index 13f9cc9..ed75645 100644
--- a/Language/Libraries_and_Scripts/Imports/namespace_changes_t09_lib.dart
+++ b/Language/Libraries_and_Scripts/Imports/namespace_changes_t09_lib.dart
@@ -6,4 +6,4 @@
class foo {}
bar() {}
-String Fwah = "blah";
+String C = "Lily was here";
diff --git a/Language/Libraries_and_Scripts/Imports/namespace_changes_t27.dart b/Language/Libraries_and_Scripts/Imports/namespace_changes_t27.dart
index fd9609b..3a83457 100644
--- a/Language/Libraries_and_Scripts/Imports/namespace_changes_t27.dart
+++ b/Language/Libraries_and_Scripts/Imports/namespace_changes_t27.dart
@@ -57,13 +57,13 @@
/// @description Checks that it is not an error when the prefix value duplicates
/// an imported name rather than local declaration (prefix being defined last).
/// @author rodionov
-/// @reviewer kaigorodov
-/// @needsreview issue 5716
+/// @issue 5716
-
+import "../../../Utils/expect.dart";
import "namespace_changes_t27_lib1.dart";
import "namespace_changes_t27_lib2.dart" as foo;
main() {
- (int, double) {} is foo.bar;
+ Expect.isTrue((int, double) {} is foo.bar);
+ checkType(checkIs<foo.bar>, true, (int, double) {});
}
diff --git a/Language/Libraries_and_Scripts/Imports/namespace_changes_t28.dart b/Language/Libraries_and_Scripts/Imports/namespace_changes_t28.dart
index 5b80407..05ad857 100644
--- a/Language/Libraries_and_Scripts/Imports/namespace_changes_t28.dart
+++ b/Language/Libraries_and_Scripts/Imports/namespace_changes_t28.dart
@@ -57,13 +57,13 @@
/// @description Checks that it is not an error when the prefix value duplicates
/// an imported name rather than local declaration (prefix being defined first).
/// @author rodionov
-/// @reviewer kaigorodov
-/// @needsreview issue 5716
+/// @issue 5716
-
+import "../../../Utils/expect.dart";
import "namespace_changes_t27_lib2.dart" as foo;
import "namespace_changes_t27_lib1.dart";
main() {
- (int, double) {} is foo.bar;
+ Expect.isTrue((int, double) {} is foo.bar);
+ checkType(checkIs<foo.bar>, true, (int, double) {});
}
diff --git a/Language/Libraries_and_Scripts/Imports/same_name_t29.dart b/Language/Libraries_and_Scripts/Imports/same_name_t29.dart
index 8bb94af..39c3b28 100644
--- a/Language/Libraries_and_Scripts/Imports/same_name_t29.dart
+++ b/Language/Libraries_and_Scripts/Imports/same_name_t29.dart
@@ -17,10 +17,9 @@
/// type test expression.
/// @author rodionov
-
import "same_name_t20_p1_lib.dart";
import "same_name_t20_p2_lib.dart";
main() {
- id is Object;
+ print(id);
}
diff --git a/Language/Libraries_and_Scripts/Imports/same_name_t39.dart b/Language/Libraries_and_Scripts/Imports/same_name_t39.dart
index 6e0c482..e666acd 100644
--- a/Language/Libraries_and_Scripts/Imports/same_name_t39.dart
+++ b/Language/Libraries_and_Scripts/Imports/same_name_t39.dart
@@ -17,10 +17,9 @@
/// expression.
/// @author rodionov
-
import "same_name_t30_lib.dart";
import "same_name_t30_lib.dart";
main() {
- id is Object;
+ print(id);
}
diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t04.dart b/Language/Libraries_and_Scripts/Parts/compilation_t04.dart
index f3a476a..ccae8e2 100644
--- a/Language/Libraries_and_Scripts/Parts/compilation_t04.dart
+++ b/Language/Libraries_and_Scripts/Parts/compilation_t04.dart
@@ -34,4 +34,5 @@
// class
A a = new A();
Expect.isTrue(a is A);
+ checkType(checkIs<A>, true, a);
}
diff --git a/Language/Libraries_and_Scripts/Parts/compilation_t15.dart b/Language/Libraries_and_Scripts/Parts/compilation_t15.dart
index 3a79bc5..9862641 100644
--- a/Language/Libraries_and_Scripts/Parts/compilation_t15.dart
+++ b/Language/Libraries_and_Scripts/Parts/compilation_t15.dart
@@ -43,4 +43,5 @@
// class
A a = new A();
Expect.isTrue(a is A);
+ checkType(checkIs<A>, true, a);
}
diff --git a/Language/Libraries_and_Scripts/private_access_t02.dart b/Language/Libraries_and_Scripts/private_access_t02.dart
index 86cd397..0a6e850 100644
--- a/Language/Libraries_and_Scripts/private_access_t02.dart
+++ b/Language/Libraries_and_Scripts/private_access_t02.dart
@@ -10,7 +10,6 @@
/// the same library.
/// @author vasya
-
import "private_access_t02_lib.dart" as lib;
main() {
diff --git a/Language/Libraries_and_Scripts/private_access_t02_lib.dart b/Language/Libraries_and_Scripts/private_access_t02_lib.dart
index 393a2d5..bda357d 100644
--- a/Language/Libraries_and_Scripts/private_access_t02_lib.dart
+++ b/Language/Libraries_and_Scripts/private_access_t02_lib.dart
@@ -20,5 +20,6 @@
Expect.equals('foo', _foo);
Expect.equals(1, _func());
Expect.equals(1, new _C()._x);
- Expect.isTrue((p1,p2) {} is _td);
+ Expect.isTrue((p1, p2) {} is _td);
+ checkType(checkIs<_td>, true, (p1, p2) {});
}
diff --git a/Language/Mixins/Mixin_Application/syntax_t07.dart b/Language/Mixins/Mixin_Application/syntax_t07.dart
index 51235b6..6cdff49 100644
--- a/Language/Mixins/Mixin_Application/syntax_t07.dart
+++ b/Language/Mixins/Mixin_Application/syntax_t07.dart
@@ -28,7 +28,9 @@
main() {
C1 c1 = new C1();
Expect.isTrue(c1 is S);
+ checkType(checkIs<S>, true, c1);
C2 c2 = new C2();
Expect.isTrue(c2 is S);
+ checkType(checkIs<S>, true, c2);
}
diff --git a/Language/Mixins/Mixin_Application/syntax_t10.dart b/Language/Mixins/Mixin_Application/syntax_t10.dart
index 42c0cce..17e6bec 100644
--- a/Language/Mixins/Mixin_Application/syntax_t10.dart
+++ b/Language/Mixins/Mixin_Application/syntax_t10.dart
@@ -29,4 +29,5 @@
main() {
C c = new C();
Expect.isTrue(c is S);
+ checkType(checkIs<S>, true, c);
}
diff --git a/Language/Overview/Scoping/conflicting_names_t39.dart b/Language/Overview/Scoping/conflicting_names_t39.dart
index 45ab941..b241819 100644
--- a/Language/Overview/Scoping/conflicting_names_t39.dart
+++ b/Language/Overview/Scoping/conflicting_names_t39.dart
@@ -12,12 +12,11 @@
/// declares two identically named optional parameters.
/// @author iefremov
-
typedef f([x, x]);
// ^
// [analyzer] unspecified
// [cfe] unspecified
main() {
- (([x, xx]) {}) is f;
+ print(f);
}
diff --git a/Language/Overview/runtime_type_t01.dart b/Language/Overview/runtime_type_t01.dart
index b61733a..c788a16 100644
--- a/Language/Overview/runtime_type_t01.dart
+++ b/Language/Overview/runtime_type_t01.dart
@@ -19,4 +19,11 @@
Expect.isTrue(true.runtimeType is Type);
Expect.isTrue(main.runtimeType is Type);
Expect.isTrue((const [1, 2, 3]).runtimeType is Type);
+
+ checkType(checkIs<Type>, true, 1.runtimeType);
+ checkType(checkIs<Type>, true, (1.1).runtimeType);
+ checkType(checkIs<Type>, true, "foo".runtimeType);
+ checkType(checkIs<Type>, true, true.runtimeType);
+ checkType(checkIs<Type>, true, main.runtimeType);
+ checkType(checkIs<Type>, true, const [1, 2, 3].runtimeType);
}
diff --git a/Language/Overview/runtime_type_t02.dart b/Language/Overview/runtime_type_t02.dart
index c028860..aaf9189 100644
--- a/Language/Overview/runtime_type_t02.dart
+++ b/Language/Overview/runtime_type_t02.dart
@@ -14,4 +14,5 @@
main() {
Expect.isTrue(null.runtimeType is Type);
+ checkType(checkIs<Type>, true, null.runtimeType);
}
diff --git a/Language/Reference/Lexical_Rules/Comments/multi_line_t10.dart b/Language/Reference/Lexical_Rules/Comments/multi_line_t10.dart
index fd1c045..3234a28 100644
--- a/Language/Reference/Lexical_Rules/Comments/multi_line_t10.dart
+++ b/Language/Reference/Lexical_Rules/Comments/multi_line_t10.dart
@@ -45,4 +45,5 @@
C c/*create instance of C*/ = new C();
Expect.isTrue(c is C );
+ checkType(checkIs<C>, true, c);
}
diff --git a/Language/Statements/Local_Variable_Declaration/syntax_t14.dart b/Language/Statements/Local_Variable_Declaration/syntax_t14.dart
index 9a99c69..5cfe51e 100644
--- a/Language/Statements/Local_Variable_Declaration/syntax_t14.dart
+++ b/Language/Statements/Local_Variable_Declaration/syntax_t14.dart
@@ -17,6 +17,7 @@
main() {
var id;
Expect.isTrue(id is dynamic);
+ checkType(checkIs<dynamic>, true, id);
id = false;
id = "";
id = 2;
diff --git a/Language/Statements/Local_Variable_Declaration/syntax_t15.dart b/Language/Statements/Local_Variable_Declaration/syntax_t15.dart
index 0dd2de8..1108ab9 100644
--- a/Language/Statements/Local_Variable_Declaration/syntax_t15.dart
+++ b/Language/Statements/Local_Variable_Declaration/syntax_t15.dart
@@ -18,6 +18,7 @@
main() {
var id = null;
Expect.isTrue(id is dynamic);
+ checkType(checkIs<dynamic>, true, id);
id = false;
id = "";
id = 2;
diff --git a/Language/Statements/Return/no_expression_not_function_t02.dart b/Language/Statements/Return/no_expression_not_function_t02.dart
index f4f2cd9..d244b14 100644
--- a/Language/Statements/Return/no_expression_not_function_t02.dart
+++ b/Language/Statements/Return/no_expression_not_function_t02.dart
@@ -27,8 +27,10 @@
main() {
Expect.isTrue(new Foo() is Foo);
+ checkType(checkIs<Foo>, true, new Foo());
Expect.isNotNull(new Foo());
Expect.isTrue(new Bar() is Bar);
+ checkType(checkIs<Bar>, true, new Bar());
Expect.isNotNull(new Bar());
}
diff --git a/Language/Types/Function_Types/assignment_t01.dart b/Language/Types/Function_Types/assignment_t01.dart
index 5448029..f5e3fa8 100644
--- a/Language/Types/Function_Types/assignment_t01.dart
+++ b/Language/Types/Function_Types/assignment_t01.dart
@@ -24,7 +24,11 @@
t1 x1c = (C x) => new C();
Expect.isTrue((A x) {return new C();} is t1);
+ checkType(checkIs<t1>, true, (A x) {return new C();});
Expect.isTrue((B x) {return new C();} is t1);
+ checkType(checkIs<t1>, true, (B x) {return new C();});
Expect.isTrue((C x) {return new C();} is t1);
+ checkType(checkIs<t1>, true, (C x) {return new C();});
Expect.isFalse((X x) {return new C();} is t1);
+ checkType(checkIs<t1>, false, (X x) {return new C();});
}
diff --git a/Language/Types/Function_Types/implements_function_t01.dart b/Language/Types/Function_Types/implements_function_t01.dart
index 5914525..7edf1d6 100644
--- a/Language/Types/Function_Types/implements_function_t01.dart
+++ b/Language/Types/Function_Types/implements_function_t01.dart
@@ -31,4 +31,13 @@
Expect.isTrue(f7 is Function);
Expect.isTrue(f8 is Function);
Expect.isTrue(f9 is Function);
+ checkType(checkIs<Function>, true, f1);
+ checkType(checkIs<Function>, true, f2);
+ checkType(checkIs<Function>, true, f3);
+ checkType(checkIs<Function>, true, f4);
+ checkType(checkIs<Function>, true, f5);
+ checkType(checkIs<Function>, true, f6);
+ checkType(checkIs<Function>, true, f7);
+ checkType(checkIs<Function>, true, f8);
+ checkType(checkIs<Function>, true, f9);
}
diff --git a/Language/Types/Function_Types/implements_function_t02.dart b/Language/Types/Function_Types/implements_function_t02.dart
index 4054689..51d3d55 100644
--- a/Language/Types/Function_Types/implements_function_t02.dart
+++ b/Language/Types/Function_Types/implements_function_t02.dart
@@ -44,6 +44,15 @@
Expect.isTrue(c.f7 is Function);
Expect.isTrue(c.f8 is Function);
Expect.isTrue(c.f9 is Function);
+ checkType(checkIs<Function>, true, c.f1);
+ checkType(checkIs<Function>, true, c.f2);
+ checkType(checkIs<Function>, true, c.f3);
+ checkType(checkIs<Function>, true, c.f4);
+ checkType(checkIs<Function>, true, c.f5);
+ checkType(checkIs<Function>, true, c.f6);
+ checkType(checkIs<Function>, true, c.f7);
+ checkType(checkIs<Function>, true, c.f8);
+ checkType(checkIs<Function>, true, c.f9);
Expect.isTrue(C.f1s is Function);
Expect.isTrue(C.f2s is Function);
@@ -54,4 +63,13 @@
Expect.isTrue(C.f7s is Function);
Expect.isTrue(C.f8s is Function);
Expect.isTrue(C.f9s is Function);
+ checkType(checkIs<Function>, true, C.f1s);
+ checkType(checkIs<Function>, true, C.f2s);
+ checkType(checkIs<Function>, true, C.f3s);
+ checkType(checkIs<Function>, true, C.f4s);
+ checkType(checkIs<Function>, true, C.f5s);
+ checkType(checkIs<Function>, true, C.f6s);
+ checkType(checkIs<Function>, true, C.f7s);
+ checkType(checkIs<Function>, true, C.f8s);
+ checkType(checkIs<Function>, true, C.f9s);
}
diff --git a/Language/Types/Function_Types/implements_function_t03.dart b/Language/Types/Function_Types/implements_function_t03.dart
index a80c954..a10cbf8 100644
--- a/Language/Types/Function_Types/implements_function_t03.dart
+++ b/Language/Types/Function_Types/implements_function_t03.dart
@@ -31,4 +31,13 @@
Expect.isTrue(f7 is Function);
Expect.isTrue(f8 is Function);
Expect.isTrue(f9 is Function);
+ checkType(checkIs<Function>, true, f1);
+ checkType(checkIs<Function>, true, f2);
+ checkType(checkIs<Function>, true, f3);
+ checkType(checkIs<Function>, true, f4);
+ checkType(checkIs<Function>, true, f5);
+ checkType(checkIs<Function>, true, f6);
+ checkType(checkIs<Function>, true, f7);
+ checkType(checkIs<Function>, true, f8);
+ checkType(checkIs<Function>, true, f9);
}
diff --git a/Language/Types/Function_Types/implements_function_t04.dart b/Language/Types/Function_Types/implements_function_t04.dart
index 611ebb9..6a98e88 100644
--- a/Language/Types/Function_Types/implements_function_t04.dart
+++ b/Language/Types/Function_Types/implements_function_t04.dart
@@ -12,11 +12,20 @@
main() {
Expect.isTrue(() {} is Function);
+ checkType(checkIs<Function>, true, () {});
Expect.isTrue((var x) {} is Function);
+ checkType(checkIs<Function>, true, (var x) {});
Expect.isTrue(((var x) => null) is Function);
+ checkType(checkIs<Function>, true, (var x) => null);
Expect.isTrue(((int x) => x) is Function);
+ checkType(checkIs<Function>, true, ((int x) => x));
Expect.isTrue((([var x]) => "aa") is Function);
- Expect.isTrue(((var x, int z, [Object? o, var v = 1]) => x + z + o + v) is Function);
+ checkType(checkIs<Function>, true, ([var x]) => "aa");
+ Expect.isTrue(
+ ((var x, int z, [Object? o, var v = 1]) => x + z + o + v) is Function);
+ checkType(checkIs<Function>, true,
+ ((var x, int z, [Object? o, var v = 1]) => x + z + o + v));
Expect.isTrue(((x, z, {o, v: 1}) => x + z + o + v) is Function);
+ checkType(checkIs<Function>, true, ((x, z, {o, v: 1}) => x + z + o + v));
}
diff --git a/Language/Types/Function_Types/implements_function_t05.dart b/Language/Types/Function_Types/implements_function_t05.dart
index 8aa7d25..8da8adb 100644
--- a/Language/Types/Function_Types/implements_function_t05.dart
+++ b/Language/Types/Function_Types/implements_function_t05.dart
@@ -30,23 +30,38 @@
Object lf3(var x, int z, {o, v: 1}) => new Object();
Expect.isTrue(() {} is Object);
+ checkType(checkIs<Object>, true, () {});
Expect.isTrue((var x) {} is Object);
+ checkType(checkIs<Object>, true, (var x) {});
Expect.isTrue(
((var x, int z, [Object? o, var v = 1]) => x + z + o + v) is Object);
+ checkType(checkIs<Object>, true, ((var x, int z, [Object? o, var v = 1]) => x + z + o + v));
Expect.isTrue(lf1 is Object);
Expect.isTrue(lf2 is Object);
Expect.isTrue(lf3 is Object);
+ checkType(checkIs<Object>, true, lf1);
+ checkType(checkIs<Object>, true, lf2);
+ checkType(checkIs<Object>, true, lf3);
Expect.isTrue(tlf1 is Object);
Expect.isTrue(tlf2 is Object);
Expect.isTrue(tlf3 is Object);
+ checkType(checkIs<Object>, true, tlf1);
+ checkType(checkIs<Object>, true, tlf2);
+ checkType(checkIs<Object>, true, tlf3);
Expect.isTrue(new C().if1 is Object);
Expect.isTrue(new C().if2 is Object);
Expect.isTrue(new C().if3 is Object);
+ checkType(checkIs<Object>, true, C().if1);
+ checkType(checkIs<Object>, true, C().if2);
+ checkType(checkIs<Object>, true, C().if3);
Expect.isTrue(C.sf1 is Object);
Expect.isTrue(C.sf2 is Object);
Expect.isTrue(C.sf3 is Object);
+ checkType(checkIs<Object>, true, C.sf1);
+ checkType(checkIs<Object>, true, C.sf2);
+ checkType(checkIs<Object>, true, C.sf3);
}
diff --git a/Language/Types/Function_Types/subtype_named_args_t01.dart b/Language/Types/Function_Types/subtype_named_args_t01.dart
index c137c50..3fb77b4 100644
--- a/Language/Types/Function_Types/subtype_named_args_t01.dart
+++ b/Language/Types/Function_Types/subtype_named_args_t01.dart
@@ -43,6 +43,12 @@
Expect.isFalse(({D? a}) {} is t1);
Expect.isTrue(({Object? a}) {} is t1);
Expect.isTrue(({var a}) {} is t1);
+ checkType(checkIs<t1>, true, ({A? a}) {});
+ checkType(checkIs<t1>, true, ({B? a}) {});
+ checkType(checkIs<t1>, false, ({C? a}) {});
+ checkType(checkIs<t1>, false, ({D? a}) {});
+ checkType(checkIs<t1>, true, ({Object? a}) {});
+ checkType(checkIs<t1>, true, ({var a}) {});
Expect.isTrue(({A? c}) {} is t2);
Expect.isTrue(({B? c}) {} is t2);
@@ -50,53 +56,102 @@
Expect.isFalse(({D? c}) {} is t2);
Expect.isTrue(({Object? c}) {} is t2);
Expect.isTrue(({var c}) {} is t2);
+ checkType(checkIs<t2>, true, ({A? c}) {});
+ checkType(checkIs<t2>, true, ({B? c}) {});
+ checkType(checkIs<t2>, true, ({C? c}) {});
+ checkType(checkIs<t2>, false, ({D? c}) {});
+ checkType(checkIs<t2>, true, ({Object? c}) {});
+ checkType(checkIs<t2>, true, ({var c}) {});
Expect.isTrue(({num? i}) {} is t3);
Expect.isTrue(({int? i}) {} is t3);
Expect.isTrue(({Object? i}) {} is t3);
Expect.isTrue(({var i}) {} is t3);
+ checkType(checkIs<t3>, true, ({num? i}) {});
+ checkType(checkIs<t3>, true, ({int? i}) {});
+ checkType(checkIs<t3>, true, ({Object? i}) {});
+ checkType(checkIs<t3>, true, ({var i}) {});
Expect.isFalse(({A? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({A? v}) {});
Expect.isFalse(({B? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({B? v}) {});
Expect.isFalse(({C? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({C? v}) {});
Expect.isFalse(({D? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({D? v}) {});
Expect.isTrue(({Object? v}) {} is t4);
+ checkType(checkIs<t4>, true, ({Object? v}) {});
Expect.isTrue(({var v}) {} is t4);
+ checkType(checkIs<t4>, true, ({var v}) {});
Expect.isFalse(({num? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({num? v}) {});
Expect.isFalse(({int? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({int? v}) {});
Expect.isFalse(({Map? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({Map? v}) {});
Expect.isFalse(({Map<List<Map<List, List<int>>>, List>? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({Map<List<Map<List, List<int>>>, List>? v}) {});
Expect.isFalse(({List? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({List? v}) {});
Expect.isFalse(({t8? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({t8? v}) {});
Expect.isFalse(({t7? v}) {} is t4);
+ checkType(checkIs<t4>, false, ({t7? v}) {});
Expect.isTrue(({Map? m}) {} is t5);
+ checkType(checkIs<t5>, true, ({Map? m}) {});
Expect.isFalse(({Map<List, t8>? m}) {} is t5);
+ checkType(checkIs<t5>, false, ({Map<List, t8>? m}) {});
Expect.isTrue(({Object? m}) {} is t5);
+ checkType(checkIs<t5>, true, ({Object? m}) {});
Expect.isTrue(({var m}) {} is t5);
+ checkType(checkIs<t5>, true, ({var m}) {});
Expect.isFalse(({Map<List, List>? m}) {} is t5);
+ checkType(checkIs<t5>, false, ({Map<List, List>? m}) {});
Expect.isFalse(({Map<int, t8>? m}) {} is t5);
+ checkType(checkIs<t5>, false, ({Map<int, t8>? m}) {});
Expect.isTrue(({Map<num, num>? m}) {} is t6);
+ checkType(checkIs<t6>, true, ({Map<num, num>? m}) {});
Expect.isFalse(({Map<int, int>? m}) {} is t6);
+ checkType(checkIs<t6>, false, ({Map<int, int>? m}) {});
Expect.isTrue(({Map? m}) {} is t6);
+ checkType(checkIs<t6>, true, ({Map? m}) {});
Expect.isTrue(({Object? m}) {} is t6);
+ checkType(checkIs<t6>, true, ({Object? m}) {});
Expect.isTrue(({var m}) {} is t6);
+ checkType(checkIs<t6>, true, ({var m}) {});
Expect.isFalse(({okWithT1_1? f}) {} is t7);
Expect.isTrue(({okWithT1_2? f}) {} is t7);
Expect.isTrue(({okWithT1_3? f}) {} is t7);
Expect.isTrue(({okWithT1_4? f}) {} is t7);
+ checkType(checkIs<t7>, false, ({okWithT1_1? f}) {});
+ checkType(checkIs<t7>, true, ({okWithT1_2? f}) {});
+ checkType(checkIs<t7>, true, ({okWithT1_3? f}) {});
+ checkType(checkIs<t7>, true, ({okWithT1_4? f}) {});
Expect.isFalse(({A? a}) {} is t8);
+ checkType(checkIs<t8>, false, ({A? a}) {});
Expect.isFalse(({B? a}) {} is t8);
+ checkType(checkIs<t8>, false, ({B? a}) {});
Expect.isFalse(({C? a}) {} is t8);
+ checkType(checkIs<t8>, false, ({C? a}) {});
Expect.isFalse(({D? a}) {} is t8);
+ checkType(checkIs<t8>, false, ({D? a}) {});
Expect.isTrue(({Object? a}) {} is t8);
+ checkType(checkIs<t8>, true, ({Object? a}) {});
Expect.isTrue(({var a}) {} is t8);
+ checkType(checkIs<t8>, true, ({var a}) {});
Expect.isFalse(({num? a}) {} is t8);
+ checkType(checkIs<t8>, false, ({num? a}) {});
Expect.isFalse(({int? a}) {} is t8);
+ checkType(checkIs<t8>, false, ({int? a}) {});
Expect.isFalse(({Map? a}) {} is t8);
+ checkType(checkIs<t8>, false, ({Map? a}) {});
Expect.isFalse(({Map<List<Map<List, List<int>>>, List>? a}) {} is t8);
+ checkType(checkIs<t8>, false, ({Map<List<Map<List, List<int>>>, List>? a}) {});
Expect.isFalse(({List? a}) {} is t8);
+ checkType(checkIs<t8>, false, ({List? a}) {});
}
diff --git a/Language/Types/Function_Types/subtype_named_args_t02.dart b/Language/Types/Function_Types/subtype_named_args_t02.dart
index e21d643..9dff980 100644
--- a/Language/Types/Function_Types/subtype_named_args_t02.dart
+++ b/Language/Types/Function_Types/subtype_named_args_t02.dart
@@ -18,10 +18,15 @@
import "../../../Utils/expect.dart";
class A {}
+
class A1 {}
+
class A2 {}
+
class B implements A, A1, A2 {}
+
class C implements B {}
+
class D implements C {}
class G<T, S, U, W> {}
@@ -35,13 +40,14 @@
typedef okWithClassesFunc_1({A? a, A1? b, A1? c, A1? d});
typedef okWithClassesFunc_2({D? a, D? b, D? c, D? d});
-typedef okWithGenericsFunc_1({Map<num, num>? m, List<List<A1>>? l, G<A, A1, A1, A1>? g});
-typedef okWithGenericsFunc_2({Map<int, int>? m, List<List<D>>? l, G<D, D, D, D>? g});
+typedef okWithGenericsFunc_1(
+ {Map<num, num>? m, List<List<A1>>? l, G<A, A1, A1, A1>? g});
+typedef okWithGenericsFunc_2(
+ {Map<int, int>? m, List<List<D>>? l, G<D, D, D, D>? g});
typedef okWithDynamicFunc_1({A? x, G? y, mixFunc z, var v});
typedef okWithDynamicFunc_2({int? x, bool y, List<Map>? z, classesFunc? v});
-
main() {
Expect.isFalse(({D? a, B? b, C? c, A? d}) {} is classesFunc);
Expect.isTrue(({A? a, A? b, A? c, A? d}) {} is classesFunc);
@@ -49,16 +55,58 @@
Expect.isFalse(({D? a, A2? b, A2? c, A2? d}) {} is classesFunc);
Expect.isFalse(({D? a, D? b, D? c, D? d}) {} is classesFunc);
Expect.isTrue(({var a, var b, var c, var d}) {} is classesFunc);
- Expect.isTrue(({Object? a, Object? b, Object? c, Object? d}) {} is classesFunc);
+ Expect.isTrue(
+ ({Object? a, Object? b, Object? c, Object? d}) {} is classesFunc);
+ checkType(checkIs<classesFunc>, false, ({D? a, B? b, C? c, A? d}) {});
+ checkType(checkIs<classesFunc>, true, ({A? a, A? b, A? c, A? d}) {});
+ checkType(checkIs<classesFunc>, false, ({D? a, A1? b, A1? c, A1? d}) {});
+ checkType(checkIs<classesFunc>, false, ({D? a, A2? b, A2? c, A2? d}) {});
+ checkType(checkIs<classesFunc>, false, ({D? a, D? b, D? c, D? d}) {});
+ checkType(checkIs<classesFunc>, true, ({var a, var b, var c, var d}) {});
+ checkType(checkIs<classesFunc>, true,
+ ({Object? a, Object? b, Object? c, Object? d}) {});
- Expect.isTrue(({Map<num, num>? m, List<List<A1>>? l, G<A, A1, A1, A1>? g}) {} is genericsFunc);
- Expect.isFalse(({Map<int, int>? m, List<List<D>>? l, G<D, D, D, D>? g}) {} is genericsFunc);
+ Expect.isTrue(({Map<num, num>? m, List<List<A1>>? l, G<A, A1, A1, A1>? g}) {}
+ is genericsFunc);
+ Expect.isFalse(({Map<int, int>? m, List<List<D>>? l, G<D, D, D, D>? g}) {}
+ is genericsFunc);
Expect.isTrue(({var m, var l, var g}) {} is genericsFunc);
Expect.isTrue(({Object? m, Object? l, Object? g}) {} is genericsFunc);
+ checkType(checkIs<genericsFunc>, true,
+ ({Map<num, num>? m, List<List<A1>>? l, G<A, A1, A1, A1>? g}) {});
+ checkType(checkIs<genericsFunc>, false,
+ ({Map<int, int>? m, List<List<D>>? l, G<D, D, D, D>? g}) {});
+ checkType(checkIs<genericsFunc>, true, ({var m, var l, var g}) {});
+ checkType(
+ checkIs<genericsFunc>, true, ({Object? m, Object? l, Object? g}) {});
Expect.isFalse(({A? x, G? y, mixFunc? z, var v}) {} is dynamicFunc);
- Expect.isFalse(({int? x, bool? y, List<Map>? z, classesFunc? v}) {} is dynamicFunc);
+ Expect.isFalse(
+ ({int? x, bool? y, List<Map>? z, classesFunc? v}) {} is dynamicFunc);
+ checkType(checkIs<dynamicFunc>, false, ({A? x, G? y, mixFunc? z, var v}) {});
+ checkType(checkIs<dynamicFunc>, false,
+ ({int? x, bool? y, List<Map>? z, classesFunc? v}) {});
- Expect.isFalse(({okWithClassesFunc_1? f1, okWithGenericsFunc_1? f2, okWithDynamicFunc_1? f3}) {} is funcFunc);
- Expect.isTrue(({okWithClassesFunc_2? f1, okWithGenericsFunc_2? f2, okWithDynamicFunc_2? f3}) {} is funcFunc);
+ Expect.isFalse((
+ {okWithClassesFunc_1? f1,
+ okWithGenericsFunc_1? f2,
+ okWithDynamicFunc_1? f3}) {} is funcFunc);
+ Expect.isTrue((
+ {okWithClassesFunc_2? f1,
+ okWithGenericsFunc_2? f2,
+ okWithDynamicFunc_2? f3}) {} is funcFunc);
+ checkType(
+ checkIs<funcFunc>,
+ false,
+ (
+ {okWithClassesFunc_1? f1,
+ okWithGenericsFunc_1? f2,
+ okWithDynamicFunc_1? f3}) {});
+ checkType(
+ checkIs<funcFunc>,
+ true,
+ (
+ {okWithClassesFunc_2? f1,
+ okWithGenericsFunc_2? f2,
+ okWithDynamicFunc_2? f3}) {});
}
diff --git a/Language/Types/Function_Types/subtype_named_args_t03.dart b/Language/Types/Function_Types/subtype_named_args_t03.dart
index a1eaf3d..c7dbeb9 100644
--- a/Language/Types/Function_Types/subtype_named_args_t03.dart
+++ b/Language/Types/Function_Types/subtype_named_args_t03.dart
@@ -19,10 +19,15 @@
import "../../../Utils/expect.dart";
class A {}
+
class A1 {}
+
class A2 {}
+
class B implements A, A1, A2 {}
+
class C implements B {}
+
class D implements C {}
class G<T, S, U, W> {}
@@ -34,19 +39,49 @@
typedef mixFunc({var x, B? b, G<A, B, C, D>? g, funcFunc f});
typedef okWithClassesFunc(A aa, {D? a, D? b, D? c, D? d});
-typedef okWithGenericsFunc({Map<int, int>? m, List<List<D>>? l, G<D, D, D, D>? g});
+typedef okWithGenericsFunc(
+ {Map<int, int>? m, List<List<D>>? l, G<D, D, D, D>? g});
typedef okWithDynamicFunc({int? x, bool? y, List<Map>? z, classesFunc? v});
-
main() {
- Expect.isTrue((var vv, {A? a, C? c, B? b, D? d, Map? xxx, Object? xxxx}) {} is classesFunc);
-
- Expect.isTrue(({List<List<B>>? l, Map<num, int>? m, G<A, B, C, D>? g}) {} is genericsFunc);
-
- Expect.isFalse(({A? x, G? y, mixFunc? z, List<Map<int, mixFunc>>? xxx, Object? xx,
- var v, mixFunc? xxxx}) {} is dynamicFunc);
-
- Expect.isTrue(({okWithClassesFunc? f1, mixFunc? xx,
- okWithDynamicFunc? f3, okWithGenericsFunc? f2}) {} is funcFunc);
-
+ Expect.isTrue((var vv, {A? a, C? c, B? b, D? d, Map? xxx, Object? xxxx}) {}
+ is classesFunc);
+ checkType(checkIs<classesFunc>, true,
+ (var vv, {A? a, C? c, B? b, D? d, Map? xxx, Object? xxxx}) {});
+ Expect.isTrue(({List<List<B>>? l, Map<num, int>? m, G<A, B, C, D>? g}) {}
+ is genericsFunc);
+ checkType(checkIs<genericsFunc>, true,
+ ({List<List<B>>? l, Map<num, int>? m, G<A, B, C, D>? g}) {});
+ Expect.isFalse((
+ {A? x,
+ G? y,
+ mixFunc? z,
+ List<Map<int, mixFunc>>? xxx,
+ Object? xx,
+ var v,
+ mixFunc? xxxx}) {} is dynamicFunc);
+ checkType(
+ checkIs<dynamicFunc>,
+ false,
+ (
+ {A? x,
+ G? y,
+ mixFunc? z,
+ List<Map<int, mixFunc>>? xxx,
+ Object? xx,
+ var v,
+ mixFunc? xxxx}) {});
+ Expect.isTrue((
+ {okWithClassesFunc? f1,
+ mixFunc? xx,
+ okWithDynamicFunc? f3,
+ okWithGenericsFunc? f2}) {} is funcFunc);
+ checkType(
+ checkIs<funcFunc>,
+ true,
+ (
+ {okWithClassesFunc? f1,
+ mixFunc? xx,
+ okWithDynamicFunc? f3,
+ okWithGenericsFunc? f2}) {});
}
diff --git a/Language/Types/Function_Types/subtype_named_args_t04.dart b/Language/Types/Function_Types/subtype_named_args_t04.dart
index 5015d25..99be1af 100644
--- a/Language/Types/Function_Types/subtype_named_args_t04.dart
+++ b/Language/Types/Function_Types/subtype_named_args_t04.dart
@@ -21,31 +21,65 @@
import "../../../Utils/expect.dart";
class A {}
+
class A1 {}
+
class A2 {}
+
class B implements A, A1, A2 {}
+
class C implements B {}
+
class D implements C {}
typedef B func(Object o);
-typedef B t1(int i, B b, Map<int, num> m, var x, {
- required var ox, required B ob, required List<num> ol, required bool obool});
+typedef B t1(int i, B b, Map<int, num> m, var x,
+ {required var ox,
+ required B ob,
+ required List<num> ol,
+ required bool obool});
-B f1(int i, B b, Map<int, num> m, var x, {
- required extraParam, required bool obool, required var ox, required D ob, required List<num>? ol}) => new B();
-D f2(int i, D b, Map<int, int> m, func x, {
- required func ox, required D ob, required List<int> ol, required bool obool}) => new D();
-C f3(num i, A b, Map<Object, Object> m, var x, {
- required var ox, required extraParam, required A2 ob, required List ol, required Object obool}) => new C();
-C f4(num i, A b, Map<Object, Object> m, var x, {
- required var ox, required A2 ob, required List ol, required bool obool, required A xx, required B yy}) => new C();
-C f5(int i, A b, Map<Object, Object> m, var x, {
- required ox, required B ob, required List ol, required obool}) => new C();
+B f1(int i, B b, Map<int, num> m, var x,
+ {required extraParam,
+ required bool obool,
+ required var ox,
+ required D ob,
+ required List<num>? ol}) =>
+ new B();
+D f2(int i, D b, Map<int, int> m, func x,
+ {required func ox,
+ required D ob,
+ required List<int> ol,
+ required bool obool}) =>
+ new D();
+C f3(num i, A b, Map<Object, Object> m, var x,
+ {required var ox,
+ required extraParam,
+ required A2 ob,
+ required List ol,
+ required Object obool}) =>
+ new C();
+C f4(num i, A b, Map<Object, Object> m, var x,
+ {required var ox,
+ required A2 ob,
+ required List ol,
+ required bool obool,
+ required A xx,
+ required B yy}) =>
+ new C();
+C f5(int i, A b, Map<Object, Object> m, var x,
+ {required ox, required B ob, required List ol, required obool}) =>
+ new C();
main() {
Expect.isFalse(f1 is t1);
+ checkType(checkIs<t1>, false, f1);
Expect.isFalse(f2 is t1);
+ checkType(checkIs<t1>, false, f2);
Expect.isFalse(f3 is t1);
+ checkType(checkIs<t1>, false, f3);
Expect.isFalse(f4 is t1);
+ checkType(checkIs<t1>, false, f4);
Expect.isTrue(f5 is t1);
+ checkType(checkIs<t1>, true, f5);
}
diff --git a/Language/Types/Function_Types/subtype_named_args_t08.dart b/Language/Types/Function_Types/subtype_named_args_t08.dart
index da61a76..567140e 100644
--- a/Language/Types/Function_Types/subtype_named_args_t08.dart
+++ b/Language/Types/Function_Types/subtype_named_args_t08.dart
@@ -26,4 +26,9 @@
Expect.isTrue(({double? d, String? s, int? x}) {} is t1);
Expect.isTrue(({String? s, double? d, int? x}) {} is t1);
Expect.isTrue(({String? s, int? x, double? d}) {} is t1);
+ checkType(checkIs<t1>, true, ({int? x, String? s, double? d}) {});
+ checkType(checkIs<t1>, true, ({double? d, int? x, String? s}) {});
+ checkType(checkIs<t1>, true, ({double? d, String? s, int? x}) {});
+ checkType(checkIs<t1>, true, ({String? s, double? d, int? x}) {});
+ checkType(checkIs<t1>, true, ({String? s, int? x, double? d}) {});
}
diff --git a/Language/Types/Function_Types/subtype_named_args_t11.dart b/Language/Types/Function_Types/subtype_named_args_t11.dart
index d660a86..7112b6e 100644
--- a/Language/Types/Function_Types/subtype_named_args_t11.dart
+++ b/Language/Types/Function_Types/subtype_named_args_t11.dart
@@ -20,10 +20,15 @@
import "../../../Utils/expect.dart";
class A {}
+
class A1 {}
+
class A2 {}
+
class B implements A, A1, A2 {}
+
class C implements B {}
+
class D implements C {}
class G<T, S, U, W> {}
@@ -35,18 +40,52 @@
typedef mixFunc({var x, B? b, G<A, B, C, D>? g, funcFunc? f});
typedef okWithClassesFunc(A aa, {D? a, D? b, D? c, D? d});
-typedef okWithGenericsFunc({Map<int, int>? m, List<List<D>>? l, G<D, D, D, D>? g});
+typedef okWithGenericsFunc(
+ {Map<int, int>? m, List<List<D>>? l, G<D, D, D, D>? g});
typedef okWithDynamicFunc({int? x, bool? y, List<Map>? z, classesFunc? v});
-
main() {
- Expect.isTrue((var vv, {A? a, B? b, C? c, D? d, Map? xxx, Object? xxxx}) {} is classesFunc);
+ Expect.isTrue((var vv, {A? a, B? b, C? c, D? d, Map? xxx, Object? xxxx}) {}
+ is classesFunc);
+ checkType(checkIs<classesFunc>, true,
+ (var vv, {A? a, B? b, C? c, D? d, Map? xxx, Object? xxxx}) {});
- Expect.isTrue(({Map<num, int>? m, List<List<B>>? l, G<A, B, C, D>? g}) {} is genericsFunc);
+ Expect.isTrue(({Map<num, int>? m, List<List<B>>? l, G<A, B, C, D>? g}) {}
+ is genericsFunc);
+ checkType(checkIs<genericsFunc>, true,
+ ({Map<num, int>? m, List<List<B>>? l, G<A, B, C, D>? g}) {});
- Expect.isFalse(({A? x, G? y, mixFunc? z, var v, Object? xx, List<Map<int, mixFunc>>? xxx,
- mixFunc? xxxx}) {} is dynamicFunc);
+ Expect.isFalse((
+ {A? x,
+ G? y,
+ mixFunc? z,
+ var v,
+ Object? xx,
+ List<Map<int, mixFunc>>? xxx,
+ mixFunc? xxxx}) {} is dynamicFunc);
+ checkType(
+ checkIs<dynamicFunc>,
+ false,
+ (
+ {A? x,
+ G? y,
+ mixFunc? z,
+ var v,
+ Object? xx,
+ List<Map<int, mixFunc>>? xxx,
+ mixFunc? xxxx}) {});
- Expect.isTrue(({okWithClassesFunc? f1, okWithGenericsFunc? f2, okWithDynamicFunc? f3, mixFunc? xx}) {} is funcFunc);
-
+ Expect.isTrue((
+ {okWithClassesFunc? f1,
+ okWithGenericsFunc? f2,
+ okWithDynamicFunc? f3,
+ mixFunc? xx}) {} is funcFunc);
+ checkType(
+ checkIs<funcFunc>,
+ true,
+ (
+ {okWithClassesFunc? f1,
+ okWithGenericsFunc? f2,
+ okWithDynamicFunc? f3,
+ mixFunc? xx}) {});
}