Partial fix for #491. Some of the mentioned issues fixed
diff --git a/LanguageFeatures/nnbd/static_errors_A04_t05.dart b/LanguageFeatures/nnbd/static_errors_A04_t05.dart
index 28b0c33..54ec37a 100644
--- a/LanguageFeatures/nnbd/static_errors_A04_t05.dart
+++ b/LanguageFeatures/nnbd/static_errors_A04_t05.dart
@@ -10,8 +10,8 @@
* or an initializer list entry, unless the variable or field is marked with the
* 'late' modifier.
*
- * @description Check that it is a compile-time error if a static variable
- * with potentially non-nullable type has no initializer expression and not
+ * @description Check that it is no compile-time error if a static variable
+ * with potentially non-nullable type has no initializer expression but
* marked with the 'late' modifier
* @author sgrekhov@unipro.ru
*/
@@ -20,8 +20,8 @@
class A {}
class C {
- static A a; //# 01: compile-time error
- static String s; //# 02: compile-time error
+ static late A a;
+ static late String s;
}
main() {
diff --git a/LanguageFeatures/nnbd/static_errors_A07_t01.dart b/LanguageFeatures/nnbd/static_errors_A07_t01.dart
index ebaafbd..852d177 100644
--- a/LanguageFeatures/nnbd/static_errors_A07_t01.dart
+++ b/LanguageFeatures/nnbd/static_errors_A07_t01.dart
@@ -15,23 +15,23 @@
// SharedOptions=--enable-experiment=non-nullable
class A {
- static void test1(var x, [A a]) {} //# 01: compile-time error
+ static void test1(var v, [A a]) {} //# 01: compile-time error
- static void test2(var x, {A a}) {} //# 02: compile-time error
+ static void test2(var v, {A a}) {} //# 02: compile-time error
}
class C<X extends A?> {
X x;
C(this.x);
- void test1<X extends A?>(var x, [X x]) {} //# 03: compile-time error
+ void test1<X extends A?>(var v, [X x]) {} //# 03: compile-time error
- void test2<X extends A?>(var x, {X x}) {} //# 04: compile-time error
+ void test2<X extends A?>(var v, {X x}) {} //# 04: compile-time error
}
-void test1<X extends A?>(var x, [X x]) {} //# 05: compile-time error
+void test1<X extends A?>(var v, [X x]) {} //# 05: compile-time error
-void test2<X extends A?>(var x, {X x}) {} //# 06: compile-time error
+void test2<X extends A?>(var v, {X x}) {} //# 06: compile-time error
main() {
A? a = new A();
diff --git a/LanguageFeatures/nnbd/static_errors_A07_t02.dart b/LanguageFeatures/nnbd/static_errors_A07_t02.dart
index 4aa5379..630f377 100644
--- a/LanguageFeatures/nnbd/static_errors_A07_t02.dart
+++ b/LanguageFeatures/nnbd/static_errors_A07_t02.dart
@@ -32,23 +32,23 @@
X x;
C(this.x);
- void test1<X extends AAlias>(var x, [X x]) {}
+ void test1<X extends AAlias>(var v, [X x]) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
- void test2<X extends AAlias>(var x, {X x}) {}
+ void test2<X extends AAlias>(var v, {X x}) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
-void test1<X extends AAlias>(var x, [X x]) {}
+void test1<X extends AAlias>(var v, [X x]) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
-void test2<X extends AAlias>(var x, {X x}) {}
+void test2<X extends AAlias>(var v, {X x}) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
diff --git a/LanguageFeatures/nnbd/static_errors_A07_t03.dart b/LanguageFeatures/nnbd/static_errors_A07_t03.dart
index dcb7e9f..831ae6b 100644
--- a/LanguageFeatures/nnbd/static_errors_A07_t03.dart
+++ b/LanguageFeatures/nnbd/static_errors_A07_t03.dart
@@ -19,23 +19,23 @@
X x;
C(this.x);
- void test1<X extends A?>(var x, [X x]) {}
+ void test1<X extends A?>(var v, [X x]) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
- void test2<X extends A?>(var x, {X x}) {}
+ void test2<X extends A?>(var v, {X x}) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
-void test1<X extends A?>(var x, [X x]) {}
+void test1<X extends A?>(var v, [X x]) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
-void test2<X extends A?>(var x, {X x}) {}
+void test2<X extends A?>(var v, {X x}) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
diff --git a/LanguageFeatures/nnbd/static_errors_A07_t04.dart b/LanguageFeatures/nnbd/static_errors_A07_t04.dart
index 267829d..735f5ba 100644
--- a/LanguageFeatures/nnbd/static_errors_A07_t04.dart
+++ b/LanguageFeatures/nnbd/static_errors_A07_t04.dart
@@ -21,23 +21,23 @@
X x;
C(this.x);
- void test1<X extends AAlias>(var x, [X x]) {}
+ void test1<X extends AAlias>(var v, [X x]) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
- void test2<X extends AAlias>(var x, {X x}) {}
+ void test2<X extends AAlias>(var v, {X x}) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
}
-void test1<X extends AAlias>(var x, [X x]) {}
+void test1<X extends AAlias>(var v, [X x]) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
-void test2<X extends AAlias>(var x, {X x}) {}
+void test2<X extends AAlias>(var v, {X x}) {}
// ^
// [analyzer] unspecified
// [cfe] unspecified
diff --git a/LanguageFeatures/nnbd/static_errors_A09_t01.dart b/LanguageFeatures/nnbd/static_errors_A09_t01.dart
index 6f8e238..71f8535 100644
--- a/LanguageFeatures/nnbd/static_errors_A09_t01.dart
+++ b/LanguageFeatures/nnbd/static_errors_A09_t01.dart
@@ -20,15 +20,27 @@
void test3({required int x}) {}
-Function test4 = ({required int x}) {};
-
typedef void Foo({required int x});
main() {
- C.test1(); //# 01: compile-time error
- C().test2(); //# 02: compile-time error
- test3(); //# 03: compile-time error
- test4(); //# 04: compile-time error
+ C.test1();
+// ^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ C().test2();
+// ^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ test3();
+// ^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
Foo foo = ({required int x}) {};
- foo(); //# 05: compile-time error
+ foo();
+// ^^^
+// [analyzer] unspecified
+// [cfe] unspecified
}
diff --git a/LanguageFeatures/nnbd/static_errors_A09_t02.dart b/LanguageFeatures/nnbd/static_errors_A09_t02.dart
index ef8b61b..1aa68c9 100644
--- a/LanguageFeatures/nnbd/static_errors_A09_t02.dart
+++ b/LanguageFeatures/nnbd/static_errors_A09_t02.dart
@@ -20,15 +20,26 @@
void test3({required int x, String y}) {}
-Function test4 = ({required int x, String y}) {};
-
typedef void Foo({required int x, String y});
main() {
- C.test1(y: ""); //# 01: compile-time error
- C().test2(y: ""); //# 02: compile-time error
- test3(y: ""); //# 03: compile-time error
- test4(y: ""); //# 04: compile-time error
+ C.test1(y: "");
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ C().test2(y: "");
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ test3(y: "");
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
Foo foo = ({required int x, String y}) {};
- foo(y: ""); //# 05: compile-time error
+ foo(y: "");
+// ^^^
+// [analyzer] unspecified
+// [cfe] unspecified
}
diff --git a/LanguageFeatures/nnbd/static_errors_A09_t03.dart b/LanguageFeatures/nnbd/static_errors_A09_t03.dart
index f6cf268..29aa4c2 100644
--- a/LanguageFeatures/nnbd/static_errors_A09_t03.dart
+++ b/LanguageFeatures/nnbd/static_errors_A09_t03.dart
@@ -20,22 +20,47 @@
void test3({required int x, String y, required String z}) {}
-Function test4 = ({required int x, String y, required String z}) {};
-
typedef void Foo({required int x, String y, required String z});
main() {
Foo foo = ({required int x, String y, required String z}) {};
- C.test1(x: 3, y: ""); //# 01: compile-time error
- C().test2(x: 1, y: ""); //# 02: compile-time error
- test3(x: 4, y: ""); //# 03: compile-time error
- test4(x: 1, y: ""); //# 04: compile-time error
- foo(x: 5, y: ""); //# 05: compile-time error
+ C.test1(x: 3, y: "");
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
- C.test1(z: "No", y: "woman"); //# 06: compile-time error
- C().test2(z: "no", y: "cry"); //# 07: compile-time error
- test3(z: "No", y: "woman"); //# 08: compile-time error
- test4(z: "no", y: "cry"); //# 09: compile-time error
- foo(z: "No", y: "woman"); //# 10: compile-time error
+ C().test2(x: 1, y: "");
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ test3(x: 4, y: "");
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ foo(x: 5, y: "");
+// ^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ C.test1(z: "No", y: "woman");
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+ C().test2(z: "no", y: "cry");
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ test3(z: "No", y: "woman");
+// ^^^^^
+// [analyzer] unspecified
+// [cfe] unspecified
+
+ foo(z: "No", y: "woman");
+// ^^^
+// [analyzer] unspecified
+// [cfe] unspecified
}
diff --git a/LanguageFeatures/nnbd/static_errors_A09_t04.dart b/LanguageFeatures/nnbd/static_errors_A09_t04.dart
index 164517c..01a137e 100644
--- a/LanguageFeatures/nnbd/static_errors_A09_t04.dart
+++ b/LanguageFeatures/nnbd/static_errors_A09_t04.dart
@@ -26,9 +26,6 @@
void test3({required A x, String y, required A z}) {}
void test33({required A? x, String y, required A? z}) {}
-Function test4 = ({required A x, String y, required A z}) {};
-Function test44 = ({required A? x, String y, required A? z}) {};
-
typedef void Foo({required A x, String y, required A z});
typedef void Foo2({required A? x, String y, required A? z});
@@ -67,16 +64,6 @@
// [analyzer] unspecified
// [cfe] unspecified
- test4(x: a, y: "");
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
-
- test44(x: a, y: "");
-// ^
-// [analyzer] unspecified
-// [cfe] unspecified
-
foo(x: a, y: "");
// ^
// [analyzer] unspecified
diff --git a/LanguageFeatures/nnbd/static_errors_A15_t01.dart b/LanguageFeatures/nnbd/static_errors_A15_t01.dart
index 6a79adb..e230a55 100644
--- a/LanguageFeatures/nnbd/static_errors_A15_t01.dart
+++ b/LanguageFeatures/nnbd/static_errors_A15_t01.dart
@@ -15,16 +15,32 @@
class A {
}
-void test(var x) {
- if (!(x is Object)) {
- throw x;
-// ^
+void test1(dynamic x) {
+ throw x;
+// ^
// [analyzer] unspecified
// [cfe] unspecified
- }
+}
+void test2(Null x) {
+ throw x;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+void test3(A? x) {
+ throw x;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
+}
+
+void test4<T extends Null>(T x) {
+ throw x;
+// ^
+// [analyzer] unspecified
+// [cfe] unspecified
}
main() {
- A? a = null;
- test(a);
}
diff --git a/LanguageFeatures/nnbd/static_errors_A20_t01.dart b/LanguageFeatures/nnbd/static_errors_A20_t01.dart
index c92c9a0..1504162 100644
--- a/LanguageFeatures/nnbd/static_errors_A20_t01.dart
+++ b/LanguageFeatures/nnbd/static_errors_A20_t01.dart
@@ -21,9 +21,9 @@
main() {
A a = A();
C c = C();
- c?.test(); //# 01: static type warning
- c?..test(); //# 02: static type warning
- c ?? a; //# 03: static type warning
+ a?.test(); //# 01: static type warning
+ a?..test(); //# 02: static type warning
+ a ?? c; //# 03: static type warning
a ??= c; //# 04: static type warning
List<C> clist = [C(), C()];
List<A> alist = [A(), C(), ...? clist]; //# 05: static type warning
diff --git a/LanguageFeatures/nnbd/static_errors_A20_t02.dart b/LanguageFeatures/nnbd/static_errors_A20_t02.dart
index f8eeae6..a03d1c4 100644
--- a/LanguageFeatures/nnbd/static_errors_A20_t02.dart
+++ b/LanguageFeatures/nnbd/static_errors_A20_t02.dart
@@ -19,19 +19,19 @@
class C extends A {}
main() {
- A a = A();
- C? c = C();
- c?.test();
- c?..test();
- c ?? a;
+ A? a = A();
+ C c = C();
+ a?.test();
+ a?..test();
+ a ?? c;
a ??= c;
List<C>? clist = [C(), C()];
List<A> alist = [A(), C(), ...? clist];
- c = null;
- c?.test();
- c?..test();
- c ?? a;
+ a = null;
+ a?.test();
+ a?..test();
+ a ?? c;
a ??= c;
clist = null;
alist = [A(), C(), ...? clist];
diff --git a/LanguageFeatures/nnbd/static_errors_A20_t03.dart b/LanguageFeatures/nnbd/static_errors_A20_t03.dart
index e4e840d..c20cea2 100644
--- a/LanguageFeatures/nnbd/static_errors_A20_t03.dart
+++ b/LanguageFeatures/nnbd/static_errors_A20_t03.dart
@@ -18,14 +18,15 @@
class C extends A {}
+typedef AAlias = A;
typedef CAlias = C;
main() {
- A a = A();
+ AAlias a = A();
CAlias c = C();
- c?.test(); //# 01: static type warning
- c?..test(); //# 02: static type warning
- c ?? a; //# 03: static type warning
+ a?.test(); //# 01: static type warning
+ a?..test(); //# 02: static type warning
+ a ?? c; //# 03: static type warning
a ??= c; //# 04: static type warning
List<CAlias?> clist = [C(), C(), null]; //# 05: static type warning
List<A> alist = [A(), C(), ...? clist]; //# 06: static type warning
diff --git a/LanguageFeatures/nnbd/static_errors_A20_t04.dart b/LanguageFeatures/nnbd/static_errors_A20_t04.dart
index 4d15d84..382c6f6 100644
--- a/LanguageFeatures/nnbd/static_errors_A20_t04.dart
+++ b/LanguageFeatures/nnbd/static_errors_A20_t04.dart
@@ -19,7 +19,7 @@
a?.foo(); //# 01: static type warning
a?..foo(); //# 02: static type warning
a ?? new Object(); //# 03: static type warning
- a ??= new Object(); //# 04: static type warning
+ a ??= new A(); //# 04: static type warning
List<A> list = [A()];
List<A> alist = [A(), A(), ...? list]; //# 05: static type warning
}
diff --git a/LanguageFeatures/nnbd/static_errors_A21_t01.dart b/LanguageFeatures/nnbd/static_errors_A21_t01.dart
index d7cd24c..eb1832b 100644
--- a/LanguageFeatures/nnbd/static_errors_A21_t01.dart
+++ b/LanguageFeatures/nnbd/static_errors_A21_t01.dart
@@ -19,6 +19,6 @@
// SharedOptions=--enable-experiment=non-nullable
main() {
- var v = null;
+ Null v = null;
v = null;
}
diff --git a/LanguageFeatures/nnbd/static_errors_A21_t03.dart b/LanguageFeatures/nnbd/static_errors_A21_t03.dart
index 7f00a09..8148d13 100644
--- a/LanguageFeatures/nnbd/static_errors_A21_t03.dart
+++ b/LanguageFeatures/nnbd/static_errors_A21_t03.dart
@@ -13,8 +13,8 @@
* dynamic
* void
*
- * @description Check that null can be assigned to nullable type. Test S* for
- * some S where S is nullable. Test type aliases
+ * @description Check that null can be assigned to nullable type. Test S? for
+ * some S. Test type aliases
* @author sgrekhov@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable,nonfunction-type-aliases
diff --git a/LanguageFeatures/nnbd/syntax_A01_t04.dart b/LanguageFeatures/nnbd/syntax_A01_t04.dart
index 644fbcb..9ed1d42 100644
--- a/LanguageFeatures/nnbd/syntax_A01_t04.dart
+++ b/LanguageFeatures/nnbd/syntax_A01_t04.dart
@@ -4,8 +4,8 @@
* BSD-style license that can be found in the LICENSE file.
*/
/**
- * @assertion A new primitive type Never. This type is denoted by the built-in
- * type declaration Never declared in dart:core.
+ * @assertion The grammar of types is extended to allow any type to be suffixed
+ * with a ? (e.g. int?) indicating the nullable version of that type.
*
* @description Check that any type can be suffixed with a ? indicating the
* nullable version of that type. Test type aliases
diff --git a/LanguageFeatures/nnbd/syntax_A05_t01.dart b/LanguageFeatures/nnbd/syntax_A05_t01.dart
index 77e1eb9..4141bc3 100644
--- a/LanguageFeatures/nnbd/syntax_A05_t01.dart
+++ b/LanguageFeatures/nnbd/syntax_A05_t01.dart
@@ -10,7 +10,7 @@
* {int? y, required int z}).
*
* @description Check that any named parameter declaration can be prefixed by
- * the 'required' modifier
+ * the 'required' modifier. Test one named required parameter
* @author sgrekhov@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable
@@ -21,7 +21,6 @@
class C {
static String test1({required String x}) => x;
String test2({required String x}) => x;
- A test3({covariant required A x}) => x;
A test4({required covariant A x}) => x;
}
@@ -37,7 +36,6 @@
A a = new A();
Expect.equals("Love me tender", C.test1(x: "Love me tender"));
Expect.equals("love me sweet", C().test2(x: "love me sweet"));
- Expect.equals(a, C().test3(x: a));
Expect.equals(a, C().test4(x: a));
Expect.equals("never let me go", test5(x: "never let me go"));
Expect.equals("You have made my life complete",
diff --git a/LanguageFeatures/nnbd/syntax_A05_t02.dart b/LanguageFeatures/nnbd/syntax_A05_t02.dart
index 7eceb24..144f468 100644
--- a/LanguageFeatures/nnbd/syntax_A05_t02.dart
+++ b/LanguageFeatures/nnbd/syntax_A05_t02.dart
@@ -10,7 +10,7 @@
* {int? y, required int z}).
*
* @description Check that any named parameter declaration can be prefixed by
- * the 'required' modifier
+ * the 'required' modifier. Test more than one named parameter
* @author sgrekhov@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable
@@ -21,8 +21,7 @@
class C {
static String test1(int x, {required String y, String z}) => y;
String test2(int x, {required String y, String z}) => y;
- A test3(int x, {covariant required String y, String z}) => y;
- A test4(int x, {required covariant String y, String z}) => y;
+ A test4(int x, {required covariant A y, String z}) => y;
}
String test5(int x, {required String y, String z}) => y;
@@ -37,7 +36,6 @@
A a = new A();
Expect.equals("Love me tender", C.test1(3, y: "Love me tender"));
Expect.equals("love me sweet", C().test2(1, y: "love me sweet", z: ""));
- Expect.equals(a, C().test3(4, y: a));
Expect.equals(a, C().test4(1, y: a, z: ""));
Expect.equals("never let me go", test5(1, y: "never let me go"));
Expect.equals("You have made my life complete",
diff --git a/LanguageFeatures/nnbd/syntax_A05_t03.dart b/LanguageFeatures/nnbd/syntax_A05_t03.dart
new file mode 100644
index 0000000..6a9feec
--- /dev/null
+++ b/LanguageFeatures/nnbd/syntax_A05_t03.dart
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
+ * for details. All rights reserved. Use of this source code is governed by a
+ * BSD-style license that can be found in the LICENSE file.
+ */
+/**
+ * @assertion The modifier required is added as a built-in identifier. The
+ * grammar of function types is extended to allow any named parameter
+ * declaration to be prefixed by the required modifier (e.g. int Function(int,
+ * {int? y, required int z}).
+ *
+ * @description Check that any named parameter declaration can be prefixed by
+ * the 'required' modifier. Test when required named parameter is not the first
+ * one
+ * @author sgrekhov@unipro.ru
+ */
+// SharedOptions=--enable-experiment=non-nullable
+import "../../Utils/expect.dart";
+
+class A {}
+
+class C {
+ static String test1(int x, {String z, required String y}) => y;
+ String test2(int x, {String z, required String y}) => y;
+
+ A test4(int x, {String z, required covariant A y}) => y;
+}
+
+String test5(int x, {String z, required String y}) => y;
+
+typedef String Foo(int x, {String z, required String y});
+
+Foo test6 = (int x, {String z, required String y}) => y;
+
+Function test7 = (int x, {String z, required String y}) => y;
+
+main() {
+ A a = new A();
+ Expect.equals("Love me tender", C.test1(3, y: "Love me tender"));
+ Expect.equals("love me sweet", C().test2(1, y: "love me sweet", z: ""));
+ Expect.equals(a, C().test4(1, y: a, z: ""));
+ Expect.equals("never let me go", test5(1, y: "never let me go"));
+ Expect.equals("You have made my life complete",
+ test6(5, y: "You have made my life complete", z: ""));
+ Expect.equals("and I love you so", test7(9, y: "and I love you so"));
+}
diff --git a/LanguageFeatures/nnbd/syntax_A08_t01.dart b/LanguageFeatures/nnbd/syntax_A08_t01.dart
index e93ed93..73f8433 100644
--- a/LanguageFeatures/nnbd/syntax_A08_t01.dart
+++ b/LanguageFeatures/nnbd/syntax_A08_t01.dart
@@ -29,4 +29,13 @@
dynamic a2 = false;
var v2 = { a2 as bool ? - 3 : 3 };
Expect.setEquals({3}, v2);
+
+ var a3 = 42;
+ var v3 = { a3 is int ? - 3 : 3 };
+ Expect.setEquals({-3}, v3);
+
+ dynamic a4 = 3.14;
+ var v4 = { a4 is int ? - 3 : 3 };
+ Expect.setEquals({3}, v4);
+
}
diff --git a/LanguageFeatures/nnbd/syntax_A08_t02.dart b/LanguageFeatures/nnbd/syntax_A08_t02.dart
deleted file mode 100644
index 33d6fb4..0000000
--- a/LanguageFeatures/nnbd/syntax_A08_t02.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
- * for details. All rights reserved. Use of this source code is governed by a
- * BSD-style license that can be found in the LICENSE file.
- */
-/**
- * @assertion Conditional expressions inside of braces are ambiguous between
- * sets and maps. That is, { a as bool ? - 3 : 3 } can be parsed as a set
- * literal { (a as bool) ? - 3 : 3 } or as a map literal
- * { (a as bool ?) - 3 : 3 }. Parsers will prefer the former parse over the
- * latter.
- *
- * The same is true for { a is int ? - 3 : 3 }.
- *
- * The same is true for { int ? - 3 : 3 } if we allow this.
- *
- * @description Check that { a is int ? - 3 : 3 } is parsed as
- * { (a is int) ? - 3 : 3 }
- * @author sgrekhov@unipro.ru
- */
-// SharedOptions=--enable-experiment=non-nullable
-import "../../Utils/expect.dart";
-
-main() {
- var a = 42;
- var v = { a is int ? - 3 : 3 };
- Expect.setEquals({-3}, v);
-
-
- dynamic a2 = 3.14;
- var v2 = { a2 is int ? - 3 : 3 };
- Expect.setEquals({3}, v2);
-}