diff --git a/Language/Classes/Instance_Methods/Operators/allowed_names_t05.dart b/Language/Classes/Instance_Methods/Operators/allowed_names_t05.dart index d60496d9e5..b298236384 100644 --- a/Language/Classes/Instance_Methods/Operators/allowed_names_t05.dart +++ b/Language/Classes/Instance_Methods/Operators/allowed_names_t05.dart @@ -20,6 +20,4 @@ main() { c!; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -//^ -// [cfe] Operand of null-aware operation '!' has type 'C' which excludes null. } diff --git a/Language/Expressions/Assignable_Expressions/getter_invocation_t02.dart b/Language/Expressions/Assignable_Expressions/getter_invocation_t02.dart index ea01f5f3b7..e9db3df390 100644 --- a/Language/Expressions/Assignable_Expressions/getter_invocation_t02.dart +++ b/Language/Expressions/Assignable_Expressions/getter_invocation_t02.dart @@ -29,13 +29,9 @@ main() { Expect.equals(1, a?.x); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. Expect.equals(20, a?.y); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. Expect.isNull(b?.x); Expect.isNull(b?.y); } diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t01.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t01.dart index cbb901f91b..f7b634e3aa 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t01.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t01.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v *= e2 is /// equivalent to the expression C.v *= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v *= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v *= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(4, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t02.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t02.dart index 50e781ff7b..cfea4f2b3e 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t02.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t02.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v /= e2 is /// equivalent to the expression C.v /= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v /= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v /= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(3, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t03.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t03.dart index 54fb991663..cc7689e5ab 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t03.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t03.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v ~/= e2 is /// equivalent to the expression C.v ~/= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v ~/= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v ~/= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(2, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t04.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t04.dart index 943f1e7ddb..cebfd1b1f7 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t04.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t04.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v %= e2 is /// equivalent to the expression C.v %= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v %= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v %= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(1, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t05.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t05.dart index b49dd4792f..2571ce0778 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t05.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t05.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v += e2 is /// equivalent to the expression C.v += e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v += 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v += 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(7, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t06.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t06.dart index 3232e61c77..dafbd67a22 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t06.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t06.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v -= e2 is /// equivalent to the expression C.v -= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v -= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v -= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(3, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t07.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t07.dart index 7910ee23b7..e7a012a45d 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t07.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t07.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v <<= e2 is /// equivalent to the expression C.v <<= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v <<= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v <<= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(20, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t08.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t08.dart index eca073c760..5957ec2b7c 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t08.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t08.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v >>= e2 is /// equivalent to the expression C.v >>= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v >>= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v >>= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(5, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t09.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t09.dart index 477bfaeb8a..e48ebcf0e6 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t09.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t09.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v &= e2 is /// equivalent to the expression C.v &= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v &= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v &= 7); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(6, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t10.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t10.dart index 3647caedee..96967fddb8 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t10.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t10.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v ^= e2 is /// equivalent to the expression C.v ^= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v ^= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v ^= 7); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(9, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t11.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t11.dart index e03a7309df..d2c3c31a67 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t11.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t11.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v |= e2 is /// equivalent to the expression C.v |= e2. /// @author sgrekhov@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v |= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v |= 7); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(15, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t12.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t12.dart index cf1322e114..ac592af817 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t12.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_static_t12.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v op= e2 is equivalent to /// the expression C.v op= e2. +/// /// @description Checks that an expression of the of the form C?.v >>>= e2 is /// equivalent to the expression C.v >>>= e2. /// @author iarkh@unipro.ru @@ -41,8 +42,6 @@ main() { Expect.throws(() {C?.v >>>= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); @@ -50,8 +49,6 @@ main() { var res3 = (C?.v >>>= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. var expected = 20 >>> 2; Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t01.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t01.dart index c65fe3bb02..4bcca0b232 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t01.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t01.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v *= e2 is equivalent /// to ((x) => x?.v = x.v * e2)(e1) where x is a variable that is not used in e2. /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v *= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(3); var res3 = (c3?.v *= 3); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(9, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t02.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t02.dart index 0439d7bf36..6c9eafbd01 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t02.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t02.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v /= e2 is equivalent /// to ((x) => x?.v = x.v / e2)(e1) where x is a variable that is not used in e2. /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v /= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(4); var res3 = (c3?.v /= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(2, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t03.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t03.dart index 0aa3d0287f..7aeed35be5 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t03.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t03.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v ~/= e2 is equivalent /// to ((x) => x?.v = x.v ~/ e2)(e1) where x is a variable that is not used in e2 /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v ~/= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(5); var res3 = (c3?.v ~/= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(2, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t04.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t04.dart index c67095a016..8918177f8c 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t04.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t04.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v %= e2 is equivalent /// to ((x) => x?.v = x.v % e2)(e1) where x is a variable that is not used in e2. /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v %= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(4); var res3 = (c3?.v %= 3); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(1, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t05.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t05.dart index 8e260922b8..ac4b77ec99 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t05.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t05.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v += e2 is equivalent /// to ((x) => x?.v = x.v + e2)(e1) where x is a variable that is not used in e2. /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v += 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(4); var res3 = (c3?.v += 3); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(7, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t06.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t06.dart index 1559f0edad..386e9edb91 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t06.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t06.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v -= e2 is equivalent /// to ((x) => x?.v = x.v - e2)(e1) where x is a variable that is not used in e2. /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v -= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(5); var res3 = (c3?.v -= 3); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(2, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t07.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t07.dart index 393879dd38..a2c8d1297e 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t07.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t07.dart @@ -5,6 +5,7 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v <<= e2 is equivalent /// to ((x) => x?.v = x.v << e2)(e1) where x is a variable that is not used in e2. /// @author sgrekhov@unipro.ru @@ -41,15 +42,11 @@ main() { Expect.throws(() {c2?.v <<= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(4); var res3 = (c3?.v <<= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(16, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t08.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t08.dart index 7b42a419e0..6c0ba50f51 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t08.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t08.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v >>= e2 is equivalent /// to ((x) => x?.v = x.v >> e2)(e1) where x is a variable that is not used in e2 /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v >>= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(20); var res3 = (c3?.v >>= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(5, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t09.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t09.dart index dc639652b3..42e3e3e2b5 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t09.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t09.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v &= e2 is equivalent /// to ((x) => x?.v = x.v & e2)(e1) where x is a variable that is not used in e2. /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v &= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(6); var res3 = (c3?.v &= 4); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(4, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t10.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t10.dart index c981979774..a48e54d60a 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t10.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t10.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v ^= e2 is equivalent /// to ((x) => x?.v = x.v ^ e2)(e1) where x is a variable that is not used in e2. /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v ^= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(14); var res3 = (c3?.v ^= 7); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(9, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t11.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t11.dart index e40bd8508b..df384f639d 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t11.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t11.dart @@ -5,11 +5,11 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v |= e2 is equivalent /// to ((x) => x?.v = x.v | e2)(e1) where x is a variable that is not used in e2. /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -42,15 +42,11 @@ main() { Expect.throws(() {c2?.v |= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(14); var res3 = (c3?.v |= 7); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); Expect.equals(15, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t12.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t12.dart index 4774731f07..a9e48fbf71 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t12.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_compound_assignment_t12.dart @@ -5,12 +5,12 @@ /// @assertion Evaluation of a compound assignment of the form e1?.v op = e2 is /// equivalent to ((x) => x?.v = x.v op e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that an expression of the form e1?.v >>>= e2 is /// equivalent to ((x) => x?.v = x.v >>> e2)(e1) where x is a variable that is /// not used in e2 /// @author iarkh@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -43,15 +43,11 @@ main() { Expect.throws(() {c2?.v >>>= 2;}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. C c3 = new C(20); var res3 = (c3?.v >>>= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var expected = 20 >>> 2; Expect.equals(1, c3.getterInvocation); Expect.equals(1, c3.setterInvocation); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_expression_assignment_t01.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_expression_assignment_t01.dart index 82e5db032e..a3950cd432 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_expression_assignment_t01.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_expression_assignment_t01.dart @@ -6,11 +6,11 @@ /// equivalent to the evaluation of the expression /// ((x) => x == null ? null: x.v?? = e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that in expression of the form e1?.v ??= e value is set /// only if e1.v == null and returns null if e1 == null /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -27,16 +27,12 @@ main() { res = (c?.v ??= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(2, res); Expect.equals(2, c.v); res = (c?.v ??= 3); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(2, res); Expect.equals(2, c.v); } diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_expression_assignment_t02.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_expression_assignment_t02.dart index 47f77c2de8..f76d78479d 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_expression_assignment_t02.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_expression_assignment_t02.dart @@ -6,11 +6,11 @@ /// equivalent to the evaluation of the expression /// ((x) => x == null ? null: x.v?? = e2)(e1) where x is a variable that is not /// used in e2. +/// /// @description Checks that in expression of the form e1?.v ??= e value is set /// only if e1.v == null and returns null if e1 == null /// @author sgrekhov@unipro.ru - import '../../../../Utils/expect.dart'; class C { @@ -43,8 +43,6 @@ main() { var res2 = (c2?.v ??= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c2.getterInvocation); Expect.equals(1, c2.setterInvocation); Expect.equals(2, res2); @@ -54,8 +52,6 @@ main() { var res3 = (c3?.v ??= 3); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(1, c3.getterInvocation); Expect.equals(0, c3.setterInvocation); Expect.equals(-1, res3); diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t01.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t01.dart index 342c405fbb..0bd7d15295 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t01.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t01.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v ??= e2 is equivalent to the /// expression C.v ??= e. +/// /// @description Checks that in expression of the form C?.v ??= e value is set /// only if C.v == null /// @author sgrekhov@unipro.ru @@ -19,14 +20,10 @@ main() { C?.v ??= 1; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.v); C?.v ??= 2; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.v); } diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t02.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t02.dart index 10c46ff60d..ce60230b39 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t02.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t02.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v ??= e2 is equivalent to the /// expression C.v ??= e. +/// /// @description Checks that in expression of the form C?.v ??= e value is set /// only if C.v == null. Test the case when C.v is prefixed /// @author sgrekhov@unipro.ru @@ -16,14 +17,10 @@ main() { lib.C?.v ??= 1; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, lib.C.v); lib.C?.v ??= 2; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, lib.C.v); } diff --git a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t03.dart b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t03.dart index 3f38bffef3..6601b477bf 100644 --- a/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t03.dart +++ b/Language/Expressions/Assignment/Compound_Assignment/null_aware_conditional_static_assignment_t03.dart @@ -4,6 +4,7 @@ /// @assertion A compound assignment of the form C?.v ??= e2 is equivalent to the /// expression C.v ??= e. +/// /// @description Checks that an expression of the form C?.v ??= e is equivalent /// to the expression C.v ??= e (in other words /// ((x) => x == null? C.v = e : x)(C.v) where x is a fresh variable that is not @@ -39,8 +40,6 @@ main() { var res = (C?.v ??= 1); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(1, C.setterInvocation); Expect.equals(1, C.v); @@ -50,8 +49,6 @@ main() { res = (C?.v ??= 2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C.getterInvocation); Expect.equals(0, C.setterInvocation); Expect.equals(1, C.v); diff --git a/Language/Expressions/Assignment/null_aware_assignment_static_type_t01.dart b/Language/Expressions/Assignment/null_aware_assignment_static_type_t01.dart index 649b0534cf..700cc216b3 100644 --- a/Language/Expressions/Assignment/null_aware_assignment_static_type_t01.dart +++ b/Language/Expressions/Assignment/null_aware_assignment_static_type_t01.dart @@ -4,11 +4,11 @@ /// @assertion Evaluation of an assignment a of the form e1?.v = e2 is ... /// The static type of a is the static type of e2 +/// /// @description Checks that the static type of e1?.v = e2 is the static type /// of e2 /// @author sgrekhov@unipro.ru - class C { var v; } @@ -19,6 +19,4 @@ main() { double? x = c?.v = e; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. } diff --git a/Language/Expressions/Assignment/null_aware_assignment_t03.dart b/Language/Expressions/Assignment/null_aware_assignment_t03.dart index d3ad403778..60ee23db80 100644 --- a/Language/Expressions/Assignment/null_aware_assignment_t03.dart +++ b/Language/Expressions/Assignment/null_aware_assignment_t03.dart @@ -5,6 +5,7 @@ /// @assertion Evaluation of an assignment a of the form e1?.v = e2 is equivalent /// to the evaluation of the expression ((x) => x == null?null : x.v = e2)(e1) /// unless e1 is a type literal, in which case it is equivalent to e1.v = e2. +/// /// @description Checks that an assignment a of the form e1?.v = e2 is equivalent /// to the evaluation of the to e1.v = e2 if e1 is a type literal /// @author sgrekhov@unipro.ru @@ -26,13 +27,9 @@ main() { var x = C?.v = e() + 1; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, C?.v); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(1, x); Expect.equals(1, count); } diff --git a/Language/Expressions/If_null_Expressions/syntax_t01.dart b/Language/Expressions/If_null_Expressions/syntax_t01.dart index f679ca6ead..fd1574500a 100644 --- a/Language/Expressions/If_null_Expressions/syntax_t01.dart +++ b/Language/Expressions/If_null_Expressions/syntax_t01.dart @@ -16,17 +16,11 @@ main() { Expect.equals(1, 1 ?? 2); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(1, 1 ?? 2 ?? 3); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(1, 1 ?? 2 ?? 3 ?? 4); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION @@ -34,75 +28,41 @@ main() { // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(2, null ?? 2); Expect.equals(1, null ?? 1 ?? 2); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(1, null ?? 1 ?? 2 ?? 3); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(1, null ?? null ?? 1 ?? 2 ?? 3); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(true, null ?? true ?? 2 ?? 3); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'bool' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'Object' which excludes null. Expect.equals(false, null ?? false ?? 2 ?? 3); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'bool' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'Object' which excludes null. Expect.equals('a', 'a' ?? 'bcd'); // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'String' which excludes null. Expect.equals('abc', 'abc' ?? 'cde' ?? 'fgh'); // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'String' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'String' which excludes null. Expect.equals('abc', null ?? 'abc' ?? 'cde' ?? 'fgh'); // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'String' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'String' which excludes null. } diff --git a/Language/Expressions/If_null_Expressions/syntax_t02.dart b/Language/Expressions/If_null_Expressions/syntax_t02.dart index 3485f6fd80..0167c73ba3 100644 --- a/Language/Expressions/If_null_Expressions/syntax_t02.dart +++ b/Language/Expressions/If_null_Expressions/syntax_t02.dart @@ -19,17 +19,11 @@ main() { Expect.equals(1, x ?? 10); // ^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(1, x ?? 10 ?? 20); // ^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(1, x ?? 10 ?? 20 ?? 30); // ^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION @@ -37,26 +31,16 @@ main() { // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION // ^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(10, n ?? 10); Expect.equals(10, n ?? 10 ?? 20); Expect.equals(10, n ?? 10 ?? 20 ?? 40); Expect.equals(x, x ?? n); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(x, n ?? x); Expect.equals(x, n ?? n ?? x); Expect.equals(x, x ?? n ?? 5); // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.equals(x, n ?? x ?? 5); } diff --git a/Language/Expressions/If_null_Expressions/syntax_t03.dart b/Language/Expressions/If_null_Expressions/syntax_t03.dart index ae39986ff8..f9b12ab269 100644 --- a/Language/Expressions/If_null_Expressions/syntax_t03.dart +++ b/Language/Expressions/If_null_Expressions/syntax_t03.dart @@ -18,12 +18,8 @@ main() { Expect.equals(2, ((x as int) + 1) ?? 10); // ^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. Expect.iterableEquals([], empty ?? 10); Expect.equals(30, (10 + 5 * 4) ?? (2 + 2 * 2)); // ^^^^^^^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'int' which excludes null. } diff --git a/Language/Expressions/Postfix_Expressions/conditional_decrement_t02.dart b/Language/Expressions/Postfix_Expressions/conditional_decrement_t02.dart index 87710f80d1..641191db55 100644 --- a/Language/Expressions/Postfix_Expressions/conditional_decrement_t02.dart +++ b/Language/Expressions/Postfix_Expressions/conditional_decrement_t02.dart @@ -5,6 +5,7 @@ /// @assertion Execution of a postfix expression of the form e1?.v-- is /// equivalent to executing ((x) => x == null? null: x.v--)(e1) unless e1 is /// a type literal, in which case it is equivalent to e1.v-- +/// /// @description Checks that if in expression e1?.v-- e1 is a type literal, /// then it is equivalent to e1.v-- /// @author sgrekhov@unipro.ru @@ -19,11 +20,7 @@ main() { Expect.equals(C?.v--, 0); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.equals(C?.v, -1); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. } diff --git a/Language/Expressions/Postfix_Expressions/static_type_t10.dart b/Language/Expressions/Postfix_Expressions/static_type_t10.dart index ccf88ddf8b..fc3b115c5b 100644 --- a/Language/Expressions/Postfix_Expressions/static_type_t10.dart +++ b/Language/Expressions/Postfix_Expressions/static_type_t10.dart @@ -6,6 +6,7 @@ /// equivalent to executing ((x) => x == null? null: x.v++)(e1) unless e1 is a /// type literal, in which case it is equivalent to e1.v++ . /// The static type of such an expression is the static type of e1.v. +/// /// @description Checks that static type of e1?.v++ is static type of e1.v. e1 /// is a type literal /// @author sgrekhov@unipro.ru @@ -19,13 +20,9 @@ main() { int? a1 = C?.v++; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. try { int? a2 = C?.v2++; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. } catch (e) {} } diff --git a/Language/Expressions/Postfix_Expressions/static_type_t12.dart b/Language/Expressions/Postfix_Expressions/static_type_t12.dart index 2ff589b555..d24c858cb6 100644 --- a/Language/Expressions/Postfix_Expressions/static_type_t12.dart +++ b/Language/Expressions/Postfix_Expressions/static_type_t12.dart @@ -6,6 +6,7 @@ /// equivalent to executing ((x) => x == null? null: x.v--)(e1) unless e1 is /// a type literal, in which case it is equivalent to e1.v-- . /// The static type of such an expression is the static type of e1.v. +/// /// @description Checks that static type of e1?.v-- is static type of e1.v. e1 /// is a type literal /// @author sgrekhov@unipro.ru @@ -19,13 +20,9 @@ main() { int? a1 = C?.v--; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. try { int? a2 = C?.v2--; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. } catch (e) {} } diff --git a/Language/Expressions/Property_Extraction/conditional_t03.dart b/Language/Expressions/Property_Extraction/conditional_t03.dart index 11b200056e..836fadc83a 100644 --- a/Language/Expressions/Property_Extraction/conditional_t03.dart +++ b/Language/Expressions/Property_Extraction/conditional_t03.dart @@ -6,6 +6,7 @@ /// the form e1?.id is equivalent to the evaluation of the expression /// ((x) => x == null?null : x.id)(e1), unless e1 is a type literal, in which /// case it is equivalent to e1.m. +/// /// @description Check that for static property e1?.id is equivalent to e1.id /// @author sgrekhov@unipro.ru @@ -19,6 +20,4 @@ main() { Expect.equals(C?.id, C.id); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. } diff --git a/Language/Expressions/Property_Extraction/conditional_t07.dart b/Language/Expressions/Property_Extraction/conditional_t07.dart index 51276b2b9c..1d96e902b5 100644 --- a/Language/Expressions/Property_Extraction/conditional_t07.dart +++ b/Language/Expressions/Property_Extraction/conditional_t07.dart @@ -6,6 +6,7 @@ /// the form e1?.id is equivalent to the evaluation of the expression /// ((x) => x == null?null : x.id)(e1), unless e1 is a type literal, in which /// case it is equivalent to e1.m. +/// /// @description Check that for static getter e1?.id is equivalent to e1.id /// @author sgrekhov@unipro.ru @@ -19,6 +20,4 @@ main() { Expect.equals(C?.id, C.id); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. } diff --git a/Language/Expressions/Property_Extraction/conditional_t08.dart b/Language/Expressions/Property_Extraction/conditional_t08.dart index 8df7a5a453..4c2fe9507d 100644 --- a/Language/Expressions/Property_Extraction/conditional_t08.dart +++ b/Language/Expressions/Property_Extraction/conditional_t08.dart @@ -6,6 +6,7 @@ /// the form e1?.id is equivalent to the evaluation of the expression /// ((x) => x == null?null : x.id)(e1), unless e1 is a type literal, in which /// case it is equivalent to e1.m. +/// /// @description Check that for static method e1?.id is equivalent to e1.id /// @author sgrekhov@unipro.ru @@ -19,6 +20,4 @@ main() { Expect.equals(C?.id, C.id); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. } diff --git a/Language/Reference/Operator_Precedence/precedence_05_logical_or_t01.dart b/Language/Reference/Operator_Precedence/precedence_05_logical_or_t01.dart index 0518515283..713d030701 100644 --- a/Language/Reference/Operator_Precedence/precedence_05_logical_or_t01.dart +++ b/Language/Reference/Operator_Precedence/precedence_05_logical_or_t01.dart @@ -26,8 +26,6 @@ main() { c.m("c1") || c.m("c2") ?? c.m("c3") || c.m("c4"); // ^^^^^^^^^^^^^^^^^^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'bool' which excludes null. Expect.equals("c1c2", log); log = ""; @@ -35,4 +33,3 @@ main() { null ?? c.m("c3") || c.m("c4"); Expect.equals("c3c4", log); } - diff --git a/LanguageFeatures/Constant-update-2018/ShortCircuitOperators_A03_t12.dart b/LanguageFeatures/Constant-update-2018/ShortCircuitOperators_A03_t12.dart index ad383830ae..8445075a97 100644 --- a/LanguageFeatures/Constant-update-2018/ShortCircuitOperators_A03_t12.dart +++ b/LanguageFeatures/Constant-update-2018/ShortCircuitOperators_A03_t12.dart @@ -5,12 +5,12 @@ /// @assertion The [??] operator only evaluates its second operand if the first /// evaluates to [null], and the second operand must be a potentially constant /// expression. +/// /// @description Checks that compile-time exception is not thrown if the first /// operand of [??] operator is not [null] regardless of the actual type of the /// second operand. /// @author iarkh@unipro.ru - const int? i = 1; const dynamic d1 = 11; const String? d2 = "check me here"; @@ -19,8 +19,6 @@ main() { const String s1 = "" ?? (124 as String); // ^^^^^^^^^^^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??' has type 'String' which excludes null. const int i1 = i ?? ("" as int); const String s2 = d2 ?? d1; const int i2 = d1 ?? d2; diff --git a/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t01.dart b/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t01.dart index 9c05debeb8..631118414e 100644 --- a/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t01.dart +++ b/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t01.dart @@ -30,6 +30,4 @@ main() { Expect.equals(42, Ext(c)?.id()); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. } diff --git a/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t02.dart b/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t02.dart index d97cb2e66a..8ab775e44a 100644 --- a/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t02.dart +++ b/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t02.dart @@ -16,7 +16,6 @@ /// @author sgrekhov@unipro.ru /// @issue 43217 - import "../../Utils/expect.dart"; class C { @@ -31,6 +30,4 @@ main() { Expect.equals(42, Ext(c)?.id); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. } diff --git a/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t03.dart b/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t03.dart index c0707836bd..f954994e98 100644 --- a/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t03.dart +++ b/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t03.dart @@ -16,7 +16,6 @@ /// @author sgrekhov@unipro.ru /// @issue 43217 - import "../../Utils/expect.dart"; class C { @@ -34,7 +33,5 @@ main() { Ext(c)?.id = 42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals(42, c.v); } diff --git a/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t04.dart b/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t04.dart index 78757edf14..1c4f548ff5 100644 --- a/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t04.dart +++ b/LanguageFeatures/Extension-methods/explicit_extension_member_invocation_A20_t04.dart @@ -16,7 +16,6 @@ /// @author sgrekhov@unipro.ru /// @issue 43217 - import "../../Utils/expect.dart"; class C { @@ -31,6 +30,4 @@ main() { Expect.equals(42, Ext(c)?[42]); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. } diff --git a/LanguageFeatures/Extension-types/nullability_A02_t01.dart b/LanguageFeatures/Extension-types/nullability_A02_t01.dart index df00d59937..b01d796d54 100644 --- a/LanguageFeatures/Extension-types/nullability_A02_t01.dart +++ b/LanguageFeatures/Extension-types/nullability_A02_t01.dart @@ -29,11 +29,9 @@ extension type ET3(T id) implements Object { this ?? print("Expect a warning here!"); // ^^ // [analyzer] unspecified -// [cfe] unspecified this?.id; // ^^ // [analyzer] unspecified -// [cfe] unspecified } } diff --git a/LanguageFeatures/Patterns/list_A05_t05.dart b/LanguageFeatures/Patterns/list_A05_t05.dart index b6c5fd5880..2ba0ac4fca 100644 --- a/LanguageFeatures/Patterns/list_A05_t05.dart +++ b/LanguageFeatures/Patterns/list_A05_t05.dart @@ -20,22 +20,17 @@ /// used in a list's rest pattern /// @author sgrekhov22@gmail.com -import "../../Utils/expect.dart"; - String test1(List list) { return switch (list) { [1, 2, 3, 4, ... var r1?] => r1.toString(), // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. [2, ...final r2?, 5, 6] => r2.toString(), // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. [.../* comment */ List r3?, 6, 7, 8] => r3.toString(), // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. _ => "default" }; } @@ -45,17 +40,14 @@ String test2(List list) { case [1, 2, 3, 4, ... var r1?]: // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. return r1.toString(); case [2, ...final r2?, 5, 6]: // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. return r2.toString(); case [... /* comment */ List r3?, 6, 7, 8]: // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. return r3.toString(); default: return "default"; @@ -66,19 +58,16 @@ String test3(List list) { if (list case [1, 2, 3, 4, ... var r1?]) { // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. return r1.toString(); } if (list case [2, ...final r2?, 5, 6]) { // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. return r2.toString(); } if (list case [... /* comment */ List r3?, 6, 7, 8]) { // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. return r3.toString(); } return "default"; diff --git a/LanguageFeatures/Patterns/null_assert_A03_t01.dart b/LanguageFeatures/Patterns/null_assert_A03_t01.dart index e9b08be00a..f0f7118d89 100644 --- a/LanguageFeatures/Patterns/null_assert_A03_t01.dart +++ b/LanguageFeatures/Patterns/null_assert_A03_t01.dart @@ -18,7 +18,6 @@ String test1(int? x) { case final int? v1! && == 1 || final int? v1!: // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_ASSERT_PATTERN -// [cfe] The null-assert pattern will have no effect because the matched type isn't nullable. return "match-1"; case int v2!: // ^^^^ @@ -33,7 +32,6 @@ String test2(int? x) { if (x case final int? v1! && == 1 || final int? v1!) { // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_ASSERT_PATTERN -// [cfe] The null-assert pattern will have no effect because the matched type isn't nullable. return "match-1"; } if (x case int v2!) { @@ -47,7 +45,6 @@ String test3(int? x) => final int? v1! && == 1 || final int? v1! => "match-1", // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_ASSERT_PATTERN -// [cfe] The null-assert pattern will have no effect because the matched type isn't nullable. int v2! => "match-2", // ^^ // [analyzer] HINT.UNREACHABLE_SWITCH_CASE diff --git a/LanguageFeatures/Patterns/null_assert_A03_t02.dart b/LanguageFeatures/Patterns/null_assert_A03_t02.dart index 45c1b62c8d..d835e40e59 100644 --- a/LanguageFeatures/Patterns/null_assert_A03_t02.dart +++ b/LanguageFeatures/Patterns/null_assert_A03_t02.dart @@ -19,7 +19,6 @@ String test1(int? value) => var a2! => "null-assert-2", // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_ASSERT_PATTERN -// [cfe] The null-assert pattern will have no effect because the matched type isn't nullable. }; String test2(int? value) { @@ -29,7 +28,6 @@ String test2(int? value) { case var a2!: // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_ASSERT_PATTERN -// [cfe] The null-assert pattern will have no effect because the matched type isn't nullable. return "null-assert-2"; default: return "default"; @@ -43,7 +41,6 @@ String test3(int? value) { case var _! when value == 42: // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_ASSERT_PATTERN -// [cfe] The null-assert pattern will have no effect because the matched type isn't nullable. return "null-assert-2"; default: return "default"; diff --git a/LanguageFeatures/Patterns/null_check_A02_t01.dart b/LanguageFeatures/Patterns/null_check_A02_t01.dart index 4dc89b3d1a..dd2933aa2a 100644 --- a/LanguageFeatures/Patterns/null_check_A02_t01.dart +++ b/LanguageFeatures/Patterns/null_check_A02_t01.dart @@ -18,12 +18,10 @@ String test1(int? x) { case int? v1! && == 1 || int? v1?: // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. return "match-1"; case int v2?: // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. // ^^^^ // [analyzer] HINT.UNREACHABLE_SWITCH_CASE return "match-2"; @@ -36,13 +34,11 @@ String test2(int? x) { if (x case int? v1! && == 1 || int? v1?) { // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. return "match-2"; } if (x case int v2?) { // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. return "match-2"; } return "no match"; @@ -53,11 +49,9 @@ String test3(int? x) => final int? v1! && == 1 || final int? v1? => "match-1", // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. int v2? => "match-2", // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN -// [cfe] The null-check pattern will have no effect because the matched type isn't nullable. // ^^ // [analyzer] HINT.UNREACHABLE_SWITCH_CASE _ => "no match" diff --git a/LanguageFeatures/Patterns/record_A02_t03.dart b/LanguageFeatures/Patterns/record_A02_t03.dart index 7d8141fd56..33f4860a0d 100644 --- a/LanguageFeatures/Patterns/record_A02_t03.dart +++ b/LanguageFeatures/Patterns/record_A02_t03.dart @@ -39,59 +39,45 @@ main() { var (a1!,) = (-1,); // ^^ // [analyzer] unspecified -// [cfe] unspecified var (n: a2!) = (n: 42); // ^^ // [analyzer] unspecified -// [cfe] unspecified var (n: a3!, // ^^ // [analyzer] unspecified -// [cfe] unspecified b3!) = (n: 42, -1); // ^^ // [analyzer] unspecified -// [cfe] unspecified final (a4!,) = (-1,); // ^^ // [analyzer] unspecified -// [cfe] unspecified final (n: a5!) = (n: 42); // ^^ // [analyzer] unspecified -// [cfe] unspecified final (n: a6!, // ^ // [analyzer] unspecified -// [cfe] unspecified b6!) = (n: 42, -1); // ^ // [analyzer] unspecified -// [cfe] unspecified final (:n2!) = (n2: 42); // ^^ // [analyzer] unspecified -// [cfe] unspecified var (num a7!,) = (-1,); // ^^ // [analyzer] unspecified -// [cfe] unspecified var (n: num a8!) = (n: 42); // ^^ // [analyzer] unspecified -// [cfe] unspecified var (n: num a9!, // ^^ // [analyzer] unspecified -// [cfe] unspecified num b9!) = (n: 42, -3); // ^^ // [analyzer] unspecified -// [cfe] unspecified var (:num n3!) = (n3: 42); // ^^ // [analyzer] unspecified -// [cfe] unspecified } diff --git a/LanguageFeatures/Set-literals/syntax_compatibility_A01_t02.dart b/LanguageFeatures/Set-literals/syntax_compatibility_A01_t02.dart index 3ebd85c776..15c61e098f 100644 --- a/LanguageFeatures/Set-literals/syntax_compatibility_A01_t02.dart +++ b/LanguageFeatures/Set-literals/syntax_compatibility_A01_t02.dart @@ -24,8 +24,6 @@ main() { var v1 = {cn?.x ?? 3, C?.n2, cn?.n1}; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.isTrue(v1 is Set); Expect.runtimeIsType(v1); Expect.iterableEquals({3, 2, null}, v1); @@ -35,8 +33,6 @@ main() { var v2 = {c?.x ?? 3, C?.n2, c?.n1}; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.isTrue(v2 is Set); Expect.runtimeIsType(v2); Expect.iterableEquals({3, 2, 1}, v2); @@ -44,8 +40,6 @@ main() { var v3 = {c?.x ?? 3, C?.n2, c?.n1}; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.isTrue(v3 is Set); Expect.runtimeIsType(v3); Expect.iterableEquals({3, 2, 1}, v3); @@ -53,8 +47,6 @@ main() { var v4 = {c?.n1 ??= (c as C).x, c?.x ??= 4, C?.n2, c?.x ?? 3}; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The class 'C' cannot be null. Expect.isTrue(v4 is Set); Expect.runtimeIsType(v4); Expect.iterableEquals({1, 4, 2}, v4); diff --git a/LanguageFeatures/Set-literals/type_inference_A07_t01.dart b/LanguageFeatures/Set-literals/type_inference_A07_t01.dart index 18402c526d..47b632215f 100644 --- a/LanguageFeatures/Set-literals/type_inference_A07_t01.dart +++ b/LanguageFeatures/Set-literals/type_inference_A07_t01.dart @@ -25,8 +25,6 @@ void test1>(T t) { var s2 = {...?t}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'T' which excludes null. Expect.isTrue(s1 is Set); Expect.isFalse(s1 is Set); Expect.isTrue(s2 is Set); @@ -42,8 +40,6 @@ void test2>(T t) { var s2 = {...?t}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'T' which excludes null. Expect.isTrue(s1 is Set); Expect.isFalse(s1 is Set); Expect.isTrue(s2 is Set); diff --git a/LanguageFeatures/Set-literals/type_inference_A08_t01.dart b/LanguageFeatures/Set-literals/type_inference_A08_t01.dart index dd8bbab14a..af7832cefc 100644 --- a/LanguageFeatures/Set-literals/type_inference_A08_t01.dart +++ b/LanguageFeatures/Set-literals/type_inference_A08_t01.dart @@ -26,8 +26,6 @@ void test1>(T t) { var m2 = {...?t}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'T' which excludes null. Expect.isTrue(m1 is Map); Expect.isTrue(m2 is Map); Expect.isFalse(m1 is Map); @@ -43,8 +41,6 @@ void test2>(T t) { var m2 = {...?t}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'T' which excludes null. Expect.isTrue(m1 is Map); Expect.isTrue(m2 is Map); Expect.isFalse(m1 is Map); diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A01_t01.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A01_t01.dart index e0002703c0..a5549a332d 100644 --- a/LanguageFeatures/Spread-collections/ConstSpreads_A01_t01.dart +++ b/LanguageFeatures/Spread-collections/ConstSpreads_A01_t01.dart @@ -4,6 +4,7 @@ /// @assertion In a constant list or set, a spread element expands at compile /// time to the series of elements contained in the spread object list. +/// /// @description Checks that a spread list element expands at compile time to the /// series of elements contained in the spread object list. /// @author iarkh@unipro.ru @@ -21,8 +22,6 @@ main() { const res2 = [...?list1]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.listEquals(list1, res2); const res3 = [...list2]; @@ -30,8 +29,6 @@ main() { const res4 = [...?list2]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.listEquals(list2, res4); const res5 = [...list3]; @@ -39,8 +36,6 @@ main() { const res6 = [...?list3]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.listEquals(list3, res6); const res7 = [...?list4]; diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A01_t02.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A01_t02.dart index 4b90d2c7ed..4028e44dd5 100644 --- a/LanguageFeatures/Spread-collections/ConstSpreads_A01_t02.dart +++ b/LanguageFeatures/Spread-collections/ConstSpreads_A01_t02.dart @@ -4,11 +4,11 @@ /// @assertion In a constant list or set, a spread element expands at compile /// time to the series of elements contained in the spread object list. +/// /// @description Checks that a spread set element expands at compile time to the /// series of elements contained in the spread object list. /// @author iarkh@unipro.ru - import "../../Utils/expect.dart"; const List list1 = [2, 7, 9]; @@ -22,8 +22,6 @@ main() { const res2 = {...?list1}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.setEquals((list1 as List).toSet(), res2); const res3 = {...list2}; @@ -31,8 +29,6 @@ main() { const res4 = {...?list2}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.setEquals((list2 as List).toSet(), res4); const res5 = {...list3}; @@ -40,8 +36,6 @@ main() { const res6 = {...?list3}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.setEquals((list3 as List).toSet(), res6); const res7 = {...?list4}; diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A06_t01.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A06_t01.dart index b974d2a1e7..a46bd58739 100644 --- a/LanguageFeatures/Spread-collections/ConstSpreads_A06_t01.dart +++ b/LanguageFeatures/Spread-collections/ConstSpreads_A06_t01.dart @@ -4,6 +4,7 @@ /// @assertion This enables in-place literals (which aren't very useful): /// const list = [...["why"]]; +/// /// @description Checks that in-place literals are enabled for lists /// @author iarkh@unipro.ru @@ -16,8 +17,6 @@ main() { const res2 = [...?["not"]]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.listEquals(["not"], res2); const res3 = [...{"why"}]; @@ -25,8 +24,6 @@ main() { const res4 = [...?{"not"}]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Set' which excludes null. Expect.listEquals(["not"], res4); const List aList = const [1, 2, 3]; @@ -35,15 +32,11 @@ main() { const res6 = [1, 2, 3, ...[4, 5, 6], ...?[7, 8, 9], aList]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.listEquals([1, 2, 3, 4, 5, 6, 7, 8, 9, aList], res6); const Set aSet = {1, 2, 3}; const res7 = [1, 2, 3, ...[4, 5, 6], ...?{7, 8, 9}, aSet]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Set' which excludes null. Expect.listEquals([1, 2, 3, 4, 5, 6, 7, 8, 9, aSet], res7); } diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A06_t02.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A06_t02.dart index 28397e6188..7c2fd7cf05 100644 --- a/LanguageFeatures/Spread-collections/ConstSpreads_A06_t02.dart +++ b/LanguageFeatures/Spread-collections/ConstSpreads_A06_t02.dart @@ -5,6 +5,7 @@ /// @assertion This enables in-place literals (which aren't very useful): /// /// const list = [...["why"]]; +/// /// @description Checks that in-place literals are enabled for sets /// @author iarkh@unipro.ru @@ -16,8 +17,6 @@ main() { const res2 = {...?["not"]}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.setEquals({"not"}, res2); const res3 = {...{"why"}}; @@ -25,8 +24,6 @@ main() { const res4 = {...?{"not"}}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Set' which excludes null. Expect.setEquals({"not"}, res4); const aList = [1, 2, 3]; @@ -37,15 +34,11 @@ main() { const res6 = {1, 2, 3, ...[4, 5, 6], ...?[7, 8, 9], aList}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.setEquals({1, 2, 3, 4, 5, 6, 7, 8, 9, aList}, res6); const aSet = {1, 2, 3}; const res7 = {1, 2, 3, ...[4, 5, 6], ...?{7, 8, 9}, aSet}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Set' which excludes null. Expect.setEquals({1, 2, 3, 4, 5, 6, 7, 8, 9, aSet}, res7); } diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A07_t01.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A07_t01.dart index 6df22e6dd9..f2073e6e3c 100644 --- a/LanguageFeatures/Spread-collections/ConstSpreads_A07_t01.dart +++ b/LanguageFeatures/Spread-collections/ConstSpreads_A07_t01.dart @@ -6,6 +6,7 @@ /// collections defined elsewhere, which is useful: /// const list = [2, 3]; /// const another = [1, ...list, 4]; // [1, 2, 3, 4]. +/// /// @description: Checks that spread element in the list can refer to constant /// collections defined elsewhere /// @author iarkh@unipro.ru @@ -22,8 +23,6 @@ main() { const res2 = [1, ...?list, 4]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.listEquals([1, 2, 3, 4], res2); const res3 = [1, ...?list1, 4]; Expect.listEquals([1, 4], res3); @@ -33,7 +32,5 @@ main() { const res5 = [1, ...?set, 4]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Set' which excludes null. Expect.listEquals([1, 2, 3, 4], res5); } diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A07_t02.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A07_t02.dart index 9cfe8f16a7..81843841a2 100644 --- a/LanguageFeatures/Spread-collections/ConstSpreads_A07_t02.dart +++ b/LanguageFeatures/Spread-collections/ConstSpreads_A07_t02.dart @@ -7,11 +7,11 @@ /// /// const list = [2, 3]; /// const another = [1, ...list, 4]; // [1, 2, 3, 4]. +/// /// @description: Checks that spread element in the set can refer to constant /// collections defined elsewhere /// @author iarkh@unipro.ru - import "../../Utils/expect.dart"; const List list = [2, 3]; @@ -24,8 +24,6 @@ main() { const res2 = {1, ...?list, 4}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.setEquals({1, 2, 3, 4}, res2); const res3 = {1, ...?list1, 4}; Expect.setEquals({1, 4}, res3); @@ -35,7 +33,5 @@ main() { const res5 = {1, ...?set, 4}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Set' which excludes null. Expect.setEquals({1, 2, 3, 4}, res5); } diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A07_t03.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A07_t03.dart index 77bddee96a..f0666e6089 100644 --- a/LanguageFeatures/Spread-collections/ConstSpreads_A07_t03.dart +++ b/LanguageFeatures/Spread-collections/ConstSpreads_A07_t03.dart @@ -7,6 +7,7 @@ /// /// const list = [2, 3]; /// const another = [1, ...list, 4]; // [1, 2, 3, 4]. +/// /// @description: Checks that spread element in the map can refer to constant /// collections defined elsewhere /// @author iarkh@unipro.ru @@ -23,8 +24,6 @@ main() { const res2 = {1: 10, ...?map, 4: 40}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals({1: 10, 2: 20, 3: 30, 4: 40}, res2); const res3 = {1: 10, ...?map1, 4: 40}; diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t12.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t12.dart index 089341bdcb..ed36b1b0a4 100644 --- a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t12.dart +++ b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t12.dart @@ -8,31 +8,25 @@ /// or [Map] instance originally created by a list, set or map literal. It is a /// potentially constant element if the expression is potentially constant /// expression. +/// /// @description: Checks that constant set spread [...?] element can be constant /// list or set or [null]. /// @author iarkh@unipro.ru - const Set? empty = {}; main() { const Set res1 = const {...?[1, 2, 3], 4}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. const Set res2 = const {...?([1, 2, 3] as List?), 4}; const Set res3 = const {5, ...?{2, 11}}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Set' which excludes null. const Set res4 = const {5, ...?({2, 11} as Set?)}; const Set res5 = const {...?{}}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Set' which excludes null. const Set res7 = const {...?null}; const Set res8 = const {...?empty}; } diff --git a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t18.dart b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t18.dart index 7a3daa67fd..87f68e2a22 100644 --- a/LanguageFeatures/Spread-collections/ConstSpreads_A10_t18.dart +++ b/LanguageFeatures/Spread-collections/ConstSpreads_A10_t18.dart @@ -8,18 +8,16 @@ /// or [Map] instance originally created by a list, set or map literal. It is a /// potentially constant element if the expression is potentially constant /// expression. +/// /// @description: Checks that constant map spread [...?] element can only be a /// constant map or null. /// @author iarkh@unipro.ru - main() { const Map res1 = const {...?({1: 1, 2: 2} as Map?), 4: 3}; const Map res2 = const {...?({} as Map?)}; const Map res3 = const {...?{}}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. const Map res4 = const {...?null}; } diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_List_A01_t01.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_List_A01_t01.dart index c9b1bba218..cf7ba2e805 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_List_A01_t01.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_List_A01_t01.dart @@ -7,6 +7,7 @@ /// 1. Create a fresh instance [list] of a class that implements [List]. /// ... /// 3. The result of the literal expression is [list]. +/// /// @description Checks that instance of [List] is created for a list literal /// @author iarkh@unipro.ru @@ -23,8 +24,6 @@ main() { Expect.isTrue([1, ...?list1, 14, 9] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([...list2, "123"] is List); Expect.isTrue([...?list3] is List); Expect.isTrue([...?list3] is List); diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_List_A02_t01.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_List_A02_t01.dart index 78ffca48db..1d50f3ed1e 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_List_A02_t01.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_List_A02_t01.dart @@ -20,7 +20,6 @@ /// added to the result list. /// @author iarkh@unipro.ru - import "../../Utils/expect.dart"; List list1 = [1, 2, 3, 4, 5]; @@ -35,8 +34,6 @@ main() { [1, ...?list4, ...?list3, ...list1]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.listEquals([], [...?list3, ...?list3, ...?list3]); Expect.listEquals([], [...list2, ...?list3]); } diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_List_A02_t04.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_List_A02_t04.dart index 4fe238cbd2..f6b1ad499c 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_List_A02_t04.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_List_A02_t04.dart @@ -60,18 +60,12 @@ main() { [-1, -2, -3, 1, 2, 3, 4, 5, 6, 7], [-1, -2, -3, ...?it1, 6, 7]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. Expect.listEquals([1, 2, 3], [1, ...it4, 2, ...?it4, 3, ...?it5]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. Expect.listEquals([-9, -8, 1, 2, 3, 4, 5, -7, "a", "14", "1", "2", null, 143, aList, -6, 100, 200, aSet, aList, 300, -5, -4, -3, -2], [-9, -8, ...it1, -7, ...?it2, -6, ...it3, -5, -4, ...it4, -3, -2]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. } diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A01_t01.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A01_t01.dart index e4fbc56f8c..c920c112e5 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A01_t01.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A01_t01.dart @@ -9,6 +9,7 @@ /// [LinkedHashMap]. /// ... /// 3. The result of the map literal expression is [map]. +/// /// @description Checks that instance of [LinkedHashMap] is created for a /// map literal /// @author iarkh@unipro.ru @@ -31,14 +32,10 @@ main() { {1: 0, ...?map1, 14: 6, 9: 9} is LinkedHashMap); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isTrue({...map2, 1: "123"} is LinkedHashMap); Expect.isTrue({...?map2} is LinkedHashMap); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isTrue({...map2} is LinkedHashMap); Expect.isTrue( {...?map3, 1: "123"} is LinkedHashMap); diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t04.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t04.dart index d6a3f502cd..fa98d57221 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t04.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t04.dart @@ -18,10 +18,10 @@ /// a. Evaluate [e1] to a value key. /// b. Evaluate [e2] to a value value. /// c. Call map[key] = value. +/// /// @description Checks that elements are added to the result map /// @author iarkh@unipro.ru - import "dart:collection"; import "../../Utils/expect.dart"; @@ -58,8 +58,6 @@ main() { {1: 1, 2: 2, 3: 3}, {1: 1, ...map4, 2: 2, ...?map4, 3: 3, ...?map5}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals({-9: 9, -8: 8, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, -7: 7, 9: "14", 8: 1, 7: 2, 6: null, -6: 6, 10: 1, 20: 2, 30: map4, 40: list, @@ -69,9 +67,5 @@ main() { // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. ...map4, -3: 3, -2: 2}); } diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t05.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t05.dart index 2bd7e0bb66..659d0a7b9d 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t05.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t05.dart @@ -18,11 +18,11 @@ /// a. Evaluate [e1] to a value key. /// b. Evaluate [e2] to a value value. /// c. Call map[key] = value. +/// /// @description Checks that final map is correct if element and spread element /// has duplicated keys /// @author iarkh@unipro.ru - import "dart:collection"; import "../../Utils/expect.dart"; @@ -42,13 +42,9 @@ main() { {-1: 1, 1: 14, -3: 3, ...?map1, 6: 6}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals( {-1: 1, 1: 14, -3: 3, ...?map2, 2: 48}, // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. {-1: 1, 1: 14, -3: 3, 4: 7, 2: 48}); } diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t06.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t06.dart index 63b3bf8765..48163d7075 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t06.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t06.dart @@ -18,11 +18,11 @@ /// a. Evaluate [e1] to a value key. /// b. Evaluate [e2] to a value value. /// c. Call map[key] = value. +/// /// @description Checks that final map is correct if its spread elements have /// duplicated keys /// @author iarkh@unipro.ru - import "dart:collection"; import "../../Utils/expect.dart"; @@ -37,17 +37,9 @@ main() { // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals({...?map2, ...?map1}, {1: 1, 2: 2, 3: 3, 4: 4, 5: 5}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. } diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t07.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t07.dart index 0c59a05b34..80427f9f6f 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t07.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t07.dart @@ -18,11 +18,11 @@ /// a. Evaluate [e1] to a value key. /// b. Evaluate [e2] to a value value. /// c. Call map[key] = value. +/// /// @description Checks that final map is correct if two its elements have /// duplicated keys /// @author iarkh@unipro.ru - import "dart:collection"; import "../../Utils/expect.dart"; @@ -63,24 +63,18 @@ main() { {8: 4, 5: 112, 1: 14, ...?map1, -6: 6}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals( {-1: 1, 4: 7, 22: 22, 2: 10}, {-1: 1, ...?map2, 22: 22, 2: 10}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals( {8: 4, 1: 1, 3: 3, 4: 4, -6: 6, 2: 20, 14: 241, 5: 7}, {8: 4, 3: 112, 1: 10, ...?map1, -6: 6, 2: 20, 14: 241, 5: 7}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals( {"p": "p", 3: 112, 146:149, 1: "test", 2: 248, 100: 218, @@ -93,7 +87,5 @@ main() { ...?verylongmap, -6: 6, 14: 20, -1000: 241, 5: 7, 121: 14, "b": "c", // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. -7: -7}); } diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t08.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t08.dart index a785321f42..c224573104 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t08.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_Map_A02_t08.dart @@ -18,10 +18,10 @@ /// a. Evaluate [e1] to a value key. /// b. Evaluate [e2] to a value value. /// c. Call map[key] = value. +/// /// @description Checks that final map is correct /// @author iarkh@unipro.ru - import "dart:collection"; import "../../Utils/expect.dart"; @@ -43,23 +43,15 @@ main() { {-1: 1, 1: 14, -3: 3, ...?map1, 6: 6, ...?map2, 4: 4, 2: 564}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals(map1, {...map1, ...map3}); Expect.mapEquals(map1, {...?map1, ...?map3}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals( {"p": "p", 146:149, 100: 218, 13: -24.11, 24: 14, 8: -8, 174: "13", 149: @@ -81,16 +73,10 @@ main() { {"c": "d", 2: -2, "y": 14, ...?map2, "p": "p", 3: 112, 1: 10, 146:149, // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. ...?verylongmap, -6: 6, 14: 20, ...?map1, -1000: 241, 5: 7, 121: 14, // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. "b": "c", -7: -7}); } diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_Set_A01_t01.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_Set_A01_t01.dart index d59e4da005..7aea64c07f 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_Set_A01_t01.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_Set_A01_t01.dart @@ -7,11 +7,11 @@ /// [LinkedHashSet]. /// ... /// 3. The result of the literal expression is [set]. +/// /// @description Checks that instance of [LinkedHashSet] is created for a /// [set] literal. /// @author iarkh@unipro.ru - import "dart:collection"; import "../../Utils/expect.dart"; @@ -26,8 +26,6 @@ main() { Expect.isTrue({1, ...?list1, 14, 9} is LinkedHashSet); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({...list2, "123"} is LinkedHashSet); Expect.isTrue({...?list3} is LinkedHashSet); Expect.isTrue({...?list3} is LinkedHashSet); diff --git a/LanguageFeatures/Spread-collections/DynamicSemantics_Set_A02_t01.dart b/LanguageFeatures/Spread-collections/DynamicSemantics_Set_A02_t01.dart index fdfda6e01d..d9d3c659e5 100644 --- a/LanguageFeatures/Spread-collections/DynamicSemantics_Set_A02_t01.dart +++ b/LanguageFeatures/Spread-collections/DynamicSemantics_Set_A02_t01.dart @@ -14,11 +14,11 @@ /// b. Evaluate set.add(iterator.current). /// iii. Else: /// a. Evaluate [set.add(value)]. +/// /// @description Checks that if element is null-aware and it's [null], nothing /// added to the result set. /// @author iarkh@unipro.ru - import "../../Utils/expect.dart"; List list1 = [100, 200, 300, 400, 500]; @@ -33,8 +33,6 @@ main() { {10, ...?list4, ...?list3, ...list1}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.setEquals({}, {...?list3, ...?list3, ...?list3}); Expect.setEquals({}, {...list2, ...?list3}); } diff --git a/LanguageFeatures/Spread-collections/NullAware_A02_t01.dart b/LanguageFeatures/Spread-collections/NullAware_A02_t01.dart index e00f500087..168fe2c079 100644 --- a/LanguageFeatures/Spread-collections/NullAware_A02_t01.dart +++ b/LanguageFeatures/Spread-collections/NullAware_A02_t01.dart @@ -17,6 +17,7 @@ /// var things = [2, null, 3]; /// var more = [1, ...things.where((thing) => thing != null), 4]; /// // [1, 2, 3, 4]. +/// /// @description Checks that [null] element is allowed inside the spreadable /// element in the list. /// @author iarkh@unipro.ru @@ -32,8 +33,6 @@ main() { var also = [1, ...?things, 4]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.listEquals([1, 2, null, 3, 4], more); more = [1, ...(things as List).where((thing) => thing != null), 4]; diff --git a/LanguageFeatures/Spread-collections/NullAware_A02_t02.dart b/LanguageFeatures/Spread-collections/NullAware_A02_t02.dart index 407549212b..74cebdcb07 100644 --- a/LanguageFeatures/Spread-collections/NullAware_A02_t02.dart +++ b/LanguageFeatures/Spread-collections/NullAware_A02_t02.dart @@ -17,11 +17,11 @@ /// var things = [2, null, 3]; /// var more = [1, ...things.where((thing) => thing != null), 4]; /// // [1, 2, 3, 4]. +/// /// @description Checks that [null] element is allowed inside the spreadable /// element in the set. /// @author iarkh@unipro.ru - import "../../Utils/expect.dart"; List things = [2, null, 3]; @@ -33,8 +33,6 @@ main() { var also = {1, ...?things, 4}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.setEquals({1, 2, null, 3, 4}, more); more = {1, ...(things as List).where((thing) => thing != null), 4}; @@ -43,7 +41,5 @@ main() { more = {1, ...?(things as List).where((thing) => thing != null), 4}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. Expect.setEquals({1, 2, 3, 4}, more); } diff --git a/LanguageFeatures/Spread-collections/NullAware_A02_t03.dart b/LanguageFeatures/Spread-collections/NullAware_A02_t03.dart index f5c34583f2..74a1de1d02 100644 --- a/LanguageFeatures/Spread-collections/NullAware_A02_t03.dart +++ b/LanguageFeatures/Spread-collections/NullAware_A02_t03.dart @@ -19,6 +19,7 @@ /// // [1, 2, 3, 4]. /// @description Checks that [null] element is allowed inside the spreadable /// element in the map. +/// /// @author iarkh@unipro.ru import "../../Utils/expect.dart"; @@ -32,7 +33,5 @@ main() { Map more1 = {4: 4, ...?things, 5: 10}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.mapEquals({4: 4, 1: 2, 2: null, 3: 3, 5: 10}, more1); } diff --git a/LanguageFeatures/Spread-collections/StaticSemantic_A02_t01.dart b/LanguageFeatures/Spread-collections/StaticSemantic_A02_t01.dart index 2eee303f92..d726803d30 100644 --- a/LanguageFeatures/Spread-collections/StaticSemantic_A02_t01.dart +++ b/LanguageFeatures/Spread-collections/StaticSemantic_A02_t01.dart @@ -4,6 +4,7 @@ /// @assertion This is true even if the object being spread is a user-defined /// class that implements [Iterable] but isn't even a subtype of List. +/// /// @description Checks that [Iterable] object can be spread into the spreadable /// list. /// @author iarkh@unipro.ru @@ -35,15 +36,9 @@ main() { Expect.listEquals(iterable?.toList(), [...iterable]); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'Iterable' which excludes null. Expect.listEquals(iterable?.toList(), [...?iterable]); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'Iterable' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. } diff --git a/LanguageFeatures/Spread-collections/TypeInference_A01_t03.dart b/LanguageFeatures/Spread-collections/TypeInference_A01_t03.dart index dd604ba4ee..e75e8fb8d6 100644 --- a/LanguageFeatures/Spread-collections/TypeInference_A01_t03.dart +++ b/LanguageFeatures/Spread-collections/TypeInference_A01_t03.dart @@ -5,11 +5,11 @@ /// @assertion If a list or set literal has a downwards inference type of /// [Iterable] for some [T], then the downwards inference context type of a /// spread element in that list is [Iterable]. +/// /// @description Checks statically that a spread element inference context type /// is [T] in the list literal /// @author iarkh@unipro.ru - class A {} class B extends A {} class C extends B {} diff --git a/LanguageFeatures/Spread-collections/TypeInference_A01_t05.dart b/LanguageFeatures/Spread-collections/TypeInference_A01_t05.dart index 21f01a630f..ebf3faf84c 100644 --- a/LanguageFeatures/Spread-collections/TypeInference_A01_t05.dart +++ b/LanguageFeatures/Spread-collections/TypeInference_A01_t05.dart @@ -5,11 +5,11 @@ /// @assertion If a list or set literal has a downwards inference type of /// [Iterable] for some [T], then the downwards inference context type of a /// spread element in that list is [Iterable]. +/// /// @description Checks statically that a spread element inference context type /// is [T] in the set literal /// @author iarkh@unipro.ru - class A {} class B extends A {} class C extends B {} @@ -35,11 +35,7 @@ main() { Set set7 = {123, "123", null, a, ...a_list, ...?b_list, c, b, ...?c_list, // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. ...str_list, ...int_list, null, 1499, []}; } diff --git a/LanguageFeatures/Spread-collections/TypeInference_A02_t01.dart b/LanguageFeatures/Spread-collections/TypeInference_A02_t01.dart index 47065ae7e7..298ffbc1fd 100644 --- a/LanguageFeatures/Spread-collections/TypeInference_A02_t01.dart +++ b/LanguageFeatures/Spread-collections/TypeInference_A02_t01.dart @@ -4,8 +4,9 @@ /// @assertion If a spread element in a list or set literal has static type /// [Iterable] for some [T], then the upwards inference element type is [T]. -/// @description Checks that spread element upwards inference element type is [T] -/// in the list literal +/// +/// @description Checks that spread element upwards inference element type is +/// [T] in the list literal /// @author iarkh@unipro.ru import "../../Utils/expect.dart"; @@ -30,63 +31,43 @@ main() { Expect.isTrue(["test", "a", ...?str_list, "ooooo"] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>(["test", "a", ...?str_list, "ooooo"]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([...a_list] is List); Expect.runtimeIsType>([...a_list]); Expect.isTrue([a, ...?a_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>([a, ...?a_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([...b_list] is List); Expect.runtimeIsType>([...b_list]); Expect.isTrue([a, ...?b_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>([a, ...?b_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([...c_list] is List); Expect.runtimeIsType>([...c_list]); Expect.isTrue([a, ...?c_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>([a, ...?c_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([a, ...a_list, ...b_list, b] is List); Expect.runtimeIsType>([a, ...a_list, ...b_list, b]); Expect.isTrue([a, b, c, ...a_list, ...b_list, ...?c_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>([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' which excludes null. Expect.isTrue([a, ...a_list, ...b_list, b] is List); Expect.runtimeIsType>([a, ...a_list, ...b_list, b]); @@ -95,49 +76,33 @@ main() { Expect.isFalse([b, ...?a_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>([b, ...?a_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([...b_list] is List); Expect.runtimeIsType>([...b_list]); Expect.isTrue([b, ...?b_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>([b, ...?b_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([...c_list] is List); Expect.runtimeIsType>([...c_list]); Expect.isTrue([b, ...?c_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>([b, ...?c_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isFalse([c, ...a_list, ...b_list, b] is List); Expect.runtimeIsNotType>([c, ...a_list, ...b_list, b]); Expect.isFalse([b, c, ...a_list, ...b_list, ...?c_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>([b, c, ...a_list, ...b_list, ...?c_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([b, ...c_list, ...b_list, b] is List); Expect.runtimeIsType>([b, ...c_list, ...b_list, b]); @@ -146,59 +111,39 @@ main() { Expect.isFalse([c, ...?a_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>([c, ...?a_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isFalse([...b_list] is List); Expect.runtimeIsNotType>([...b_list]); Expect.isFalse([c, ...?b_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>([c, ...?b_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([...c_list] is List); Expect.runtimeIsType>([...c_list]); Expect.isTrue([...?c_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>([...?c_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue([c, ...?c_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>([c, ...?c_list]); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isFalse([c, ...a_list, ...b_list, c] is List); Expect.runtimeIsNotType>([c, ...a_list, ...b_list, c]); Expect.isFalse([c, ...a_list, ...b_list, ...?c_list] is List); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>([c, ...a_list, ...b_list, ...?c_list] ); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isFalse([a, ...c_list, ...b_list, b] is List); Expect.runtimeIsNotType>([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 ee98d36a93..50df788aee 100644 --- a/LanguageFeatures/Spread-collections/TypeInference_A02_t02.dart +++ b/LanguageFeatures/Spread-collections/TypeInference_A02_t02.dart @@ -4,8 +4,9 @@ /// @assertion If a spread element in a list or set literal has static type /// [Iterable] for some [T], then the upwards inference element type is [T]. -/// @description Checks that spread element upwards inference element type is [T] -/// in the set literal +/// +/// @description Checks that spread element upwards inference element type is +/// [T] in the set literal /// @author iarkh@unipro.ru import "../../Utils/expect.dart"; @@ -30,62 +31,42 @@ main() { Expect.isTrue({"test", "a", ...?str_list, "ooooo"} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>({"test", "a", ...?str_list, "ooooo"}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({...a_list} is Set); Expect.runtimeIsType>({...a_list}); Expect.isTrue({a, ...?a_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>({a, ...?a_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({...b_list} is Set); Expect.runtimeIsType>({...b_list}); Expect.isTrue({a, ...?b_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>({a, ...?b_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({...c_list} is Set); Expect.runtimeIsType>({...c_list}); Expect.isTrue({a, ...?c_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>({a, ...?c_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({a, ...a_list, ...b_list, b} is Set); Expect.runtimeIsType>({a, ...a_list, ...b_list, b}); Expect.isTrue({a, b, c, ...a_list, ...b_list, ...?c_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>({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' which excludes null. Expect.isTrue({a, ...a_list, ...b_list, b} is Set); Expect.runtimeIsType>({a, ...a_list, ...b_list, b}); @@ -94,49 +75,33 @@ main() { Expect.isFalse({b, ...?a_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>({b, ...?a_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({...b_list} is Set); Expect.runtimeIsType>({...b_list}); Expect.isTrue({b, ...?b_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>({...?b_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({...c_list} is Set); Expect.runtimeIsType>({...c_list}); Expect.isTrue({b, ...?c_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>({...?c_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isFalse({c, ...a_list, ...b_list, b} is Set); Expect.runtimeIsNotType>({c, ...a_list, ...b_list, b}); Expect.isFalse({b, c, ...a_list, ...b_list, ...?c_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>({b, c, ...a_list, ...b_list, ...?c_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({b, ...c_list, ...b_list, b} is Set); Expect.runtimeIsType>({b, ...c_list, ...b_list, b}); @@ -145,59 +110,39 @@ main() { Expect.isFalse({c, ...?a_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>({c, ...?a_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isFalse({...b_list} is Set); Expect.runtimeIsNotType>({c, ...b_list}); Expect.isFalse({c, ...?b_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>({c, ...?b_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({...c_list} is Set); Expect.runtimeIsType>({...c_list}); Expect.isTrue({...?c_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>({...?c_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isTrue({c, ...?c_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsType>({c, ...?c_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isFalse({c, ...a_list, ...b_list, c} is Set); Expect.runtimeIsNotType>({c, ...a_list, ...b_list, c}); Expect.isFalse({c, ...a_list, ...b_list, ...?c_list} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.runtimeIsNotType>({c, ...a_list, ...b_list, ...?c_list}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. Expect.isFalse({a, ...c_list, ...b_list, b} is Set); Expect.runtimeIsNotType>({a, ...c_list, ...b_list, b}); } diff --git a/LanguageFeatures/Spread-collections/TypeInference_A03_t02.dart b/LanguageFeatures/Spread-collections/TypeInference_A03_t02.dart index c855e224b0..e1ea8f7cd9 100644 --- a/LanguageFeatures/Spread-collections/TypeInference_A03_t02.dart +++ b/LanguageFeatures/Spread-collections/TypeInference_A03_t02.dart @@ -2,14 +2,14 @@ // 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 If a map literal has a downwards inference type of [Map] for -/// some [K] and [V], then the downwards inference context type of a spread +/// @assertion If a map literal has a downwards inference type of [Map] +/// for some [K] and [V], then the downwards inference context type of a spread /// element in that map is [Map]. +/// /// @description Checks statically that a spread element inference context type /// is [K, V] in the map literal /// @author iarkh@unipro.ru - class A1 {} class B1 extends A1 {} class C1 extends B1 {} @@ -32,31 +32,21 @@ main() { Map map2 = {new A1(): new A2(), ...?a_map}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Map map3 = {new A1(): new A2(), ...b_map}; Map map4 = {new A1(): new A2(), ...c_map, new B1(): new C2()}; Map map5 = {new A1(): new B2(), new B1(): new C2(), new C1(): new C2(), ...?c_map, new B1(): new A2(), ...a_map, ...b_map, // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. new A1(): new C2()}; Map map6 = {new B1(): new B2(), ...?b_map, new C1(): new C2(), // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. ...c_map}; 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: []}; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. } diff --git a/LanguageFeatures/Spread-collections/TypeInference_A04_t01.dart b/LanguageFeatures/Spread-collections/TypeInference_A04_t01.dart index 5df0024b38..9a13f9323f 100644 --- a/LanguageFeatures/Spread-collections/TypeInference_A04_t01.dart +++ b/LanguageFeatures/Spread-collections/TypeInference_A04_t01.dart @@ -5,11 +5,11 @@ /// @assertion If a spread element in a map literal has static type [Map] /// for some [K] and [V], then the upwards inference key type is [K] and the /// value type is [V]. +/// /// @description Checks that spread element upwards inference key type is [K] and /// the value type is [V] in the map literal /// @author iarkh@unipro.ru - import "../../Utils/expect.dart"; class A1 {} @@ -42,64 +42,44 @@ main() { Expect.isTrue({1: "test", 2: "a", ...?str_map, 3: "oo"} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsType>({1: "test", 2: "a", ...?str_map, 3: "oo"}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isTrue({...a_map} is Map); Expect.runtimeIsType>({...a_map}); Expect.isTrue({a1: a2, ...?a_map} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsType>({a1: a2, ...?a_map}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isTrue({...b_map} is Map); Expect.runtimeIsType>({...b_map}); Expect.isTrue({a1: a2, ...?b_map} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsType>({a1: a2, ...?b_map}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isTrue({...c_map} is Map); Expect.runtimeIsType>({...c_map}); Expect.isTrue({a1: a2, ...?c_map} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsType>({a1: a2, ...?c_map}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isTrue({a1: a2, ...a_map, ...b_map, b1: b2} is Map); Expect.runtimeIsType>({a1: a2, ...a_map, ...b_map, b1: b2} ); Expect.isTrue( {a1: a2, b1: b2, c1: c2, ...a_map, ...?b_map, ...c_map} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsType>( {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' which excludes null. Expect.isTrue({a1: a2, ...a_map, ...b_map, b1: b2} is Map); Expect.runtimeIsType>({a1: a2, ...a_map, ...b_map, b1: b2}); @@ -108,51 +88,35 @@ main() { Expect.isFalse({b1: b2, ...?a_map} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsNotType>({b1: b2, ...?a_map}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isTrue({...b_map} is Map); Expect.runtimeIsType>({...b_map}); Expect.isTrue({b1: b2, ...?b_map} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsType>({b1: b2, ...?b_map}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isTrue({...c_map} is Map); Expect.runtimeIsType>({...c_map}); Expect.isTrue({b1: b2, ...?c_map} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsType>({b1: b2, ...?c_map}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isFalse({c1: c2, ...a_map, ...b_map, b1: b2} is Map); Expect.runtimeIsNotType>({c1: c2, ...a_map, ...b_map, b1: b2}); Expect.isFalse( {b1: b2, c1: c2, ...a_map, ...b_map, ...?c_map} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsNotType>( {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' which excludes null. Expect.isFalse({a1: a2, ...c_map, ...b_map, b1: b2} is Map); Expect.runtimeIsNotType>({a1: a2, ...c_map, ...b_map, b1: b2}); } diff --git a/LanguageFeatures/Spread-collections/TypeInference_A05_t04.dart b/LanguageFeatures/Spread-collections/TypeInference_A05_t04.dart index 24830309f2..cfbe1eb1da 100644 --- a/LanguageFeatures/Spread-collections/TypeInference_A05_t04.dart +++ b/LanguageFeatures/Spread-collections/TypeInference_A05_t04.dart @@ -13,6 +13,7 @@ /// {...x, ...l} // Statically a set, runtime error when spreading x. /// {...x, ...m} // Statically a map, no runtime error. /// {...l, ...m} // Static error, because it must be both a set and a map. +/// /// @description Checks that if one of the spreadable element is [Iterable], /// result is statically [Set] /// @author iarkh@unipro.ru @@ -28,13 +29,9 @@ main() { Expect.throws(() => res = {...?l, ...map}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. Expect.throws(() => res = {...map, ...?l}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. Expect.throws(() => res = {...l, ...?map}); Expect.throws(() => res = {...?map, ...l}); @@ -42,24 +39,16 @@ main() { Expect.throws(() => res = {...?l, ...?map}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. Expect.throws(() => res = {...?map, ...?l}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. Expect.isTrue({...set, ...?l} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. Expect.isTrue({...?l, ...set} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. Expect.isTrue({...?set, ...l} is Set); Expect.isTrue({...l, ...?set} is Set); @@ -67,6 +56,4 @@ main() { Expect.isTrue({...?set, ...?l} is Set); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Iterable' which excludes null. } diff --git a/LanguageFeatures/Spread-collections/TypeInference_A05_t06.dart b/LanguageFeatures/Spread-collections/TypeInference_A05_t06.dart index a448e4ce7f..07cb2d050b 100644 --- a/LanguageFeatures/Spread-collections/TypeInference_A05_t06.dart +++ b/LanguageFeatures/Spread-collections/TypeInference_A05_t06.dart @@ -13,11 +13,11 @@ /// {...x, ...l} // Statically a set, runtime error when spreading x. /// {...x, ...m} // Statically a map, no runtime error. /// {...l, ...m} // Static error, because it must be both a set and a map. +/// /// @description Checks that if one of the spreadable element is [Map], result /// is statically [Map] /// @author iarkh@unipro.ru - import "../../Utils/expect.dart"; main() { @@ -25,17 +25,12 @@ main() { dynamic set = {}; Map m = {}; - Map res; Expect.throws(() => res = {...?m, ...set}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.throws(() => res = {...set, ...?m}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.throws(() => res = {...m, ...?set}); Expect.throws(() => res = {...?set, ...m}); @@ -43,8 +38,6 @@ main() { Expect.throws(() => res = {...?set, ...?m}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.isTrue({...?map, ...m} is Map); Expect.runtimeIsType({...?map, ...m}); @@ -54,32 +47,20 @@ main() { Expect.isTrue({...map, ...?m} is Map); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. Expect.runtimeIsType({...map, ...?m}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' 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' which excludes null. Expect.runtimeIsType({...?m, ...map}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' 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' which excludes null. Expect.runtimeIsType({...?map, ...?m}); // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'Map' which excludes null. } diff --git a/LanguageFeatures/int-to-double/assignment_class_member_t01.dart b/LanguageFeatures/int-to-double/assignment_class_member_t01.dart index 4ff22056b2..75987ae2e9 100644 --- a/LanguageFeatures/int-to-double/assignment_class_member_t01.dart +++ b/LanguageFeatures/int-to-double/assignment_class_member_t01.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion The static type of a double valued integer literal is [double] +/// /// @description Checks that the static type of a double valued integer literal /// is [double]. Test class member assignment /// @author sgrekhov@unipro.ru @@ -30,26 +31,16 @@ main() { C?.s = -42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] The class 'C' cannot be null. C.s ??= 42; // ^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. C?.s ??= -42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] The class 'C' cannot be null. -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. C.staticSetter = -42; C?.staticSetter = 42; -//^ -// [cfe] The class 'C' cannot be null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -66,23 +57,15 @@ main() { c?.m1 = 42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. c?.instanceSetter = -42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. c.m1 ??= -42; // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. c?.m1 ??= 42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. } diff --git a/LanguageFeatures/int-to-double/assignment_class_member_t02.dart b/LanguageFeatures/int-to-double/assignment_class_member_t02.dart index 7b8a02c064..11590f94ff 100644 --- a/LanguageFeatures/int-to-double/assignment_class_member_t02.dart +++ b/LanguageFeatures/int-to-double/assignment_class_member_t02.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion The static type of a double valued integer literal is [double] +/// /// @description Checks that the static type of a double valued integer literal /// is [double]. Test class member assignment and hexadecimal values /// @author sgrekhov@unipro.ru @@ -30,28 +31,18 @@ main() { C?.s = -0x42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] The class 'C' cannot be null. C.s ??= 0x42; // ^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. C?.s ??= -0x42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] The class 'C' cannot be null. -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. C.staticSetter = -0x42; C?.staticSetter = 0x42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] The class 'C' cannot be null. C? c = null; c?.m1 = 0x42; @@ -65,23 +56,15 @@ main() { c?.m1 = 0x42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. c?.instanceSetter = -0x42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. c.m1 ??= -0x42; // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. c?.m1 ??= 0x42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR // ^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. } diff --git a/LanguageFeatures/int-to-double/assignment_local_variable_t01.dart b/LanguageFeatures/int-to-double/assignment_local_variable_t01.dart index c48593e469..dc2fedc2ec 100644 --- a/LanguageFeatures/int-to-double/assignment_local_variable_t01.dart +++ b/LanguageFeatures/int-to-double/assignment_local_variable_t01.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion The static type of a double valued integer literal is [double] +/// /// @description Checks that the static type of a double valued integer literal /// is [double]. Test local variable assignment /// @author sgrekhov@unipro.ru - class C { static void staticMethod() { @@ -23,8 +23,6 @@ class C { s1 ??= -42; // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. } void instanceMethod() { @@ -40,8 +38,6 @@ class C { m1 ??= -42; // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. } } @@ -58,8 +54,6 @@ void foo() { l1 ??= -42; // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. } main() { @@ -75,8 +69,6 @@ main() { d1 ??= -42; // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. foo(); C.staticMethod(); @@ -95,8 +87,6 @@ main() { b1 ??= -42; // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. } bar(); } diff --git a/LanguageFeatures/int-to-double/assignment_local_variable_t02.dart b/LanguageFeatures/int-to-double/assignment_local_variable_t02.dart index 7e847e07d6..c8f3877e71 100644 --- a/LanguageFeatures/int-to-double/assignment_local_variable_t02.dart +++ b/LanguageFeatures/int-to-double/assignment_local_variable_t02.dart @@ -3,11 +3,11 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion The static type of a double valued integer literal is [double] +/// /// @description Checks that the static type of a double valued integer literal /// is [double]. Test local variable assignment and hexadecimal literals /// @author sgrekhov@unipro.ru - class C { static void staticMethod() { @@ -23,8 +23,6 @@ class C { s1 ??= -0x42; // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. } void instanceMethod() { @@ -40,8 +38,6 @@ class C { m1 ??= -0x42; // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. } } @@ -58,8 +54,6 @@ void foo() { l1 ??= -0x42; // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. } @@ -76,8 +70,6 @@ main() { d1 ??= -0x42; // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. foo(); C.staticMethod(); @@ -96,8 +88,6 @@ main() { b1 ??= -0x42; // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'double' which excludes null. } bar(); } diff --git a/LanguageFeatures/int-to-double/assignment_this_t01.dart b/LanguageFeatures/int-to-double/assignment_this_t01.dart index a33d5c94f1..7f7ba8b6bf 100644 --- a/LanguageFeatures/int-to-double/assignment_this_t01.dart +++ b/LanguageFeatures/int-to-double/assignment_this_t01.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion The static type of a double valued integer literal is [double] +/// /// @description Checks that the static type of a double valued integer literal /// is [double]. Test this assignment expression /// @author sgrekhov@unipro.ru /// @issue 43461 - class C { double? m1; @@ -23,21 +23,15 @@ class C { this?.m1 = -42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The receiver 'this' cannot be null. this.m1 ??= 42; this?.m1 ??= -42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The receiver 'this' cannot be null. this.instanceSetter = 42; this?.instanceSetter = -42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The receiver 'this' cannot be null. } } diff --git a/LanguageFeatures/int-to-double/assignment_this_t02.dart b/LanguageFeatures/int-to-double/assignment_this_t02.dart index fa57f9bec3..b1a468fa26 100644 --- a/LanguageFeatures/int-to-double/assignment_this_t02.dart +++ b/LanguageFeatures/int-to-double/assignment_this_t02.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion The static type of a double valued integer literal is [double] +/// /// @description Checks that the static type of a double valued integer literal /// is [double]. Test this assignment expression and hexadecimal values /// @author sgrekhov@unipro.ru /// @issue 43461 - class C { double? m1; @@ -23,21 +23,15 @@ class C { this?.m1 = -0x42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The receiver 'this' cannot be null. this.m1 ??= 0x42; this?.m1 ??= -0x42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The receiver 'this' cannot be null. this.instanceSetter = 0x42; this?.instanceSetter = -0x42; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] The receiver 'this' cannot be null. } } diff --git a/LanguageFeatures/nnbd/null_aware_operator_A13_t13.dart b/LanguageFeatures/nnbd/null_aware_operator_A13_t13.dart index 3f460e6776..e14b045df5 100644 --- a/LanguageFeatures/nnbd/null_aware_operator_A13_t13.dart +++ b/LanguageFeatures/nnbd/null_aware_operator_A13_t13.dart @@ -41,15 +41,11 @@ void testShort(C? x, int index, dynamic value) { var actual = x?[index] ??= value; // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'int' which excludes null. var n0 = x; x?.init(); var expected = n0 == null ? null : n0[index] ??= value; // ^^^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'int' which excludes null. Expect.equals(expected, actual); } diff --git a/LanguageFeatures/nnbd/null_aware_operator_A17_t01.dart b/LanguageFeatures/nnbd/null_aware_operator_A17_t01.dart index de763f8c33..77f661215c 100644 --- a/LanguageFeatures/nnbd/null_aware_operator_A17_t01.dart +++ b/LanguageFeatures/nnbd/null_aware_operator_A17_t01.dart @@ -38,8 +38,6 @@ main() { var actual1 = c1 ?.. test1; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected = c1; Expect.equals(expected, actual1); Expect.equals("test1 called 1 times, test2() called 0 times", c1.log); @@ -47,14 +45,10 @@ main() { var actual2 = c1 ?.. test2(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected, actual2); Expect.equals("test1 called 1 times, test2() called 1 times", c1.log); var actual3 = c1 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. test1 // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -78,31 +72,21 @@ main() { var actual7 = c2 ?.. test1; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected2 = c2; Expect.equals(expected2, actual7); Expect.equals("test1 called 1 times, test2() called 0 times", c2?.log); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var actual8 = c2 ?.. test2(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected2, actual8); Expect.equals("test1 called 1 times, test2() called 1 times", c2?.log); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var actual9 = c2 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. test1 // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -111,6 +95,4 @@ main() { Expect.equals("test1 called 2 times, test2() called 2 times", c2?.log); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. } diff --git a/LanguageFeatures/nnbd/null_aware_operator_A17_t02.dart b/LanguageFeatures/nnbd/null_aware_operator_A17_t02.dart index 2552ff05c8..c8919fca5f 100644 --- a/LanguageFeatures/nnbd/null_aware_operator_A17_t02.dart +++ b/LanguageFeatures/nnbd/null_aware_operator_A17_t02.dart @@ -41,8 +41,6 @@ main() { var actual1 = c1 ?.. test1; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected = c1; Expect.equals(expected, actual1); @@ -51,15 +49,11 @@ main() { var actual2 = c1 ?.. test2(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected, actual2); Expect.equals("test1 called 1 times, test2() called 1 times", c1.log); var actual3 = c1 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. test1 // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -83,31 +77,21 @@ main() { var actual7 = c2 ?.. test1; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected2 = c2; Expect.equals(expected2, actual7); Expect.equals("test1 called 1 times, test2() called 0 times", c2?.log); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var actual8 = c2 ?.. test2(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected2, actual8); Expect.equals("test1 called 1 times, test2() called 1 times", c2?.log); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var actual9 = c2 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. test1 // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -116,14 +100,10 @@ main() { Expect.equals("test1 called 2 times, test2() called 2 times", c2?.log); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. CAlias2 c3 = new C(); var actual10 = c3 ?.. test1; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected3 = c3; Expect.equals(expected3, actual10); if (c3 != null) { @@ -133,8 +113,6 @@ main() { var actual11 = c3 ?.. test2(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected3, actual11); if (c3 != null) { @@ -142,8 +120,6 @@ main() { } var actual12 = c3 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. test1 // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -170,33 +146,23 @@ main() { var actual16 = c4 ?.. test1; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected4 = c4; Expect.equals(expected4, actual16); Expect.equals("test1 called 1 times, test2() called 0 times", c4?.log); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var actual17 = c4 ?.. test2(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected4, actual17); Expect.equals("test1 called 1 times, test2() called 1 times", c4?.log); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var actual18 = c4 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. test1 // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -205,6 +171,4 @@ main() { Expect.equals("test1 called 2 times, test2() called 2 times", c4?.log); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. } diff --git a/LanguageFeatures/nnbd/null_aware_operator_A17_t06.dart b/LanguageFeatures/nnbd/null_aware_operator_A17_t06.dart index 438f67695b..f84ce63df7 100644 --- a/LanguageFeatures/nnbd/null_aware_operator_A17_t06.dart +++ b/LanguageFeatures/nnbd/null_aware_operator_A17_t06.dart @@ -32,8 +32,6 @@ main() { var actual1 = c1 ?.. test1 = "Show must go on"; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected = c1; Expect.equals(expected, actual1); Expect.equals("Show must go on", c1.test1); @@ -41,14 +39,10 @@ main() { var actual2 = c1 ?.. test2 = "Lily was here"; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected, actual2); Expect.equals("Lily was here", c1._test2); var actual3 = c1 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. test1 = "Let it be" // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -73,31 +67,21 @@ main() { var actual7 = c2 ?.. test1 = "Let it be"; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected2 = c2; Expect.equals(expected2, actual7); Expect.equals("Let it be", c2?.test1); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var actual8 = c2 ?.. test2 = "Let it be"; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected2, actual8); Expect.equals("Let it be", c2?._test2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var actual9 = c2 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. test1 = "Show must go on" // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -106,11 +90,7 @@ main() { Expect.equals("Show must go on", c2?.test1); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. Expect.equals("Show must go on", c2?._test2); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. } diff --git a/LanguageFeatures/nnbd/null_aware_operator_A17_t07.dart b/LanguageFeatures/nnbd/null_aware_operator_A17_t07.dart index 17bf878933..d7dabbc15a 100644 --- a/LanguageFeatures/nnbd/null_aware_operator_A17_t07.dart +++ b/LanguageFeatures/nnbd/null_aware_operator_A17_t07.dart @@ -47,15 +47,11 @@ main() { var actual1 = c1 ?.. m1().m(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected = c1; Expect.equals(expected, actual1); Expect.equals(1, c1.m1().counter); var actual3 = c1 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. m1().m() // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -77,19 +73,13 @@ main() { var actual7 = c2 ?.. m1().m(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected2 = c2; Expect.equals(expected2, actual7); Expect.equals(1, c2?.m1().counter); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. var actual9 = c2 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. m1().m() // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR diff --git a/LanguageFeatures/nnbd/null_aware_operator_A17_t08.dart b/LanguageFeatures/nnbd/null_aware_operator_A17_t08.dart index 9af2edda3b..834b1c5ec8 100644 --- a/LanguageFeatures/nnbd/null_aware_operator_A17_t08.dart +++ b/LanguageFeatures/nnbd/null_aware_operator_A17_t08.dart @@ -47,8 +47,6 @@ main() { var actual1 = c1 ?.. m1()?.m(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected = c1; Expect.equals(expected, actual1); var val1 = c1.m1(); @@ -57,8 +55,6 @@ main() { } var actual2 = c1 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. m1()?.m() // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -77,14 +73,10 @@ main() { var actual3 = c1 ?.. m1()?.m(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected, actual3); Expect.equals(5, c1.counter1); var actual4 = c1 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. m1()?.m() // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -101,8 +93,6 @@ main() { if (c2 != null) { var actual6 = c2 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. m1()?.m() // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -114,22 +104,16 @@ main() { var actual7 = c2 ?.. m1()?.m(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. var expected2 = c2; Expect.equals(expected2, actual7); var val5 = c2?.m1(); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. if (val5 != null) { Expect.equals(1, val5.counter); } var actual8 = c2 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. m1()?.m() // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR @@ -148,14 +132,10 @@ main() { var actual9 = c1 ?.. m1()?.m(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. Expect.equals(expected, actual9); Expect.equals(7, c1.counter1); var actual10 = c1 -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'C' which excludes null. ?.. m1()?.m() // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A01_t01.dart index 518bfb59da..15c3326034 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A01_t01.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A01_t01.dart @@ -33,13 +33,9 @@ main() { Expect.throws(() {a!?.foo();}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. Expect.throws(() {a!?[42];}); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. Expect.throws(() {a!.s = "Lily was here";}); Expect.throws(() {a![0] = "Lily was here";}); A? a1 = new A(); diff --git a/LanguageFeatures/nnbd/null_check_operator_A01_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A01_t02.dart index b51961c3f4..03bd62bfeb 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A01_t02.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A01_t02.dart @@ -11,7 +11,6 @@ /// @issue 39723 /// @issue 41193 - class A { String s = "Show must go on"; foo() {} @@ -26,41 +25,29 @@ main() { var a = new A() as A?; a!; a!.foo(); -//^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION a![42]; -//^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION a!?.foo(); // ^^^ // [analyzer] unspecified -// [cfe] unspecified a!?[42]; // ^^^ // [analyzer] unspecified -// [cfe] unspecified a!.s = "Lily was here"; -//^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION a!?.s = "Let it be"; // ^^^ // [analyzer] unspecified -// [cfe] unspecified a![0] = "Lily was here"; -//^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION a!?[0] = "Lily was here"; // ^^^ // [analyzer] unspecified -// [cfe] unspecified if (a != null) { a.getValue!; a[42]!; diff --git a/LanguageFeatures/nnbd/null_check_operator_A03_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A03_t01.dart index d759d80837..62ec55c0c9 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A03_t01.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A03_t01.dart @@ -24,46 +24,32 @@ class A { test() { this!; -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION this!.foo(); -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION this![42]; -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION this!?.foo(); // ^^^ // [analyzer] unspecified -// [cfe] unspecified this!?[42]; // ^^ // [analyzer] unspecified -// [cfe] unspecified this!.s = "Lily was here"; -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION this!?.s = "Lily was here"; // ^^^ // [analyzer] unspecified -// [cfe] unspecified this![0] = "Lily was here"; -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION this!?[0] = "Lily was here"; // ^^^ // [analyzer] unspecified -// [cfe] unspecified this.getValue!; this[42]!; } diff --git a/LanguageFeatures/nnbd/null_check_operator_A03_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A03_t02.dart index 3949ef2838..4860617faf 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A03_t02.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A03_t02.dart @@ -21,13 +21,9 @@ extension on C { Expect.equals("Lily was here: 42", this!(42)); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'C' which excludes null. Expect.equals("Lily was here: 42", this(42)!); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'String' which excludes null. } String call(int v) => "Lily was here: $v"; } diff --git a/LanguageFeatures/nnbd/null_check_operator_A03_t03.dart b/LanguageFeatures/nnbd/null_check_operator_A03_t03.dart index e1869e7cae..5f142ad525 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A03_t03.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A03_t03.dart @@ -20,13 +20,9 @@ class C { Expect.equals("Lily was here: 42", this!(42)); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'C' which excludes null. Expect.equals("Lily was here: 42", this(42)!); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'String' which excludes null. } String call(int v) => "Lily was here: $v"; } diff --git a/LanguageFeatures/nnbd/null_check_operator_A05_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A05_t01.dart index c8ab71dd2e..47d829a64e 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A05_t01.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A05_t01.dart @@ -10,25 +10,17 @@ /// @author sgrekhov@unipro.ru /// @issue 39723 - main() { 42!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'int' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION 42!.abs(); -//^ -// [cfe] Operand of null-aware operation '!' has type 'int' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION 42!?.abs(); //^^^^^^ // [analyzer] unspecified -// [cfe] unspecified 42.abs()!; -// ^ -// [cfe] Operand of null-aware operation '!' has type 'int' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/null_check_operator_A05_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A05_t02.dart index 2be93da242..11894d508b 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A05_t02.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A05_t02.dart @@ -25,21 +25,13 @@ main() { Expect.equals("Lily was here 2 times", 42!(2)); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'int' which excludes null. Expect.equals(24, 42![24]); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'int' which excludes null. 42![24] = 24; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -//^ -// [cfe] Operand of null-aware operation '!' has type 'int' which excludes null. 42!.s = 24; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -//^ -// [cfe] Operand of null-aware operation '!' has type 'int' which excludes null. } diff --git a/LanguageFeatures/nnbd/null_check_operator_A06_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A06_t01.dart index d738f92238..77446cb28a 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A06_t01.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A06_t01.dart @@ -30,66 +30,40 @@ main() { new A()!; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A()!.foo(); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A()![42]; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A()!?.foo(); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. new A()!?[42]; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. new A().getValue!; new A()[42]!; new A()!.s = "Lily was here"; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A()!?.s = "Lily was here"; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. new A()![0] = "Lily was here"; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A()!?[0] = "Lily was here"; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. Expect.throws(() {new A().getNull!;}); Expect.throws(() {new A()[null]!;}); } diff --git a/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart index e1f9b6f663..9ca56b69d6 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A06_t02.dart @@ -35,66 +35,40 @@ main() { new A.named("Let's have fun")!; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A.named("Let's have fun")!.foo(); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A.named("Let's have fun")![42]; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A.named("Let's have fun")!?.foo(); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. new A.named("Let's have fun")!?[42]; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. new A.named("Let's have fun").getValue!; new A.named("Let's have fun")[42]!; new A.named("Let's have fun")!.s = "Lily was here"; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A.named("Let's have fun")!?.s = "Lily was here"; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. new A.named("Let's have fun")![0] = "Lily was here"; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. new A.named("Let's have fun")!?[0] = "Lily was here"; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. Expect.throws(() {new A.named("Let's have fun").getNull!;}); Expect.throws(() {new A.named("Let's have fun")[null]!;}); } diff --git a/LanguageFeatures/nnbd/null_check_operator_A07_t01.dart b/LanguageFeatures/nnbd/null_check_operator_A07_t01.dart index 749f2e4e1b..1d2fb209bd 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A07_t01.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A07_t01.dart @@ -10,25 +10,17 @@ /// @author sgrekhov@unipro.ru /// @issue 39723 - main() { true!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'bool' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION true!.toString(); -//^ -// [cfe] Operand of null-aware operation '!' has type 'bool' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION true!?.toString(); // ^^^ // [analyzer] unspecified -// [cfe] unspecified true.toString()!; -// ^ -// [cfe] Operand of null-aware operation '!' has type 'String' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/null_check_operator_A07_t02.dart b/LanguageFeatures/nnbd/null_check_operator_A07_t02.dart index 89da07e691..34ff17c68c 100644 --- a/LanguageFeatures/nnbd/null_check_operator_A07_t02.dart +++ b/LanguageFeatures/nnbd/null_check_operator_A07_t02.dart @@ -25,21 +25,13 @@ main() { Expect.equals("Lily was here 2 times", true!(2)); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'bool' which excludes null. Expect.equals(24, true![24]); // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -// ^ -// [cfe] Operand of null-aware operation '!' has type 'bool' which excludes null. true![24] = 24; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -//^ -// [cfe] Operand of null-aware operation '!' has type 'bool' which excludes null. true!.s = 24; // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION -//^ -// [cfe] Operand of null-aware operation '!' has type 'bool' which excludes null. } diff --git a/LanguageFeatures/nnbd/static_errors_A14_t03.dart b/LanguageFeatures/nnbd/static_errors_A14_t03.dart index df1838b9e9..5f32a9431c 100644 --- a/LanguageFeatures/nnbd/static_errors_A14_t03.dart +++ b/LanguageFeatures/nnbd/static_errors_A14_t03.dart @@ -26,25 +26,15 @@ main() { f1?.toString(); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'Function' which excludes null. f1 ?.. toString(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?..' has type 'Function' which excludes null. Foo f2 = foo; f2?.toString(); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'void Function()' which excludes null. f2 ?.. toString(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?..' has type 'void Function()' which excludes null. } - - diff --git a/LanguageFeatures/nnbd/static_errors_A14_t05.dart b/LanguageFeatures/nnbd/static_errors_A14_t05.dart index 51785684ee..3185558912 100644 --- a/LanguageFeatures/nnbd/static_errors_A14_t05.dart +++ b/LanguageFeatures/nnbd/static_errors_A14_t05.dart @@ -26,16 +26,10 @@ main() { a?.test(); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. a ?.. test(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?..' has type 'A' which excludes null. a?[0]; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. } diff --git a/LanguageFeatures/nnbd/static_errors_A14_t13.dart b/LanguageFeatures/nnbd/static_errors_A14_t13.dart index 324b15a0df..3711b74a3e 100644 --- a/LanguageFeatures/nnbd/static_errors_A14_t13.dart +++ b/LanguageFeatures/nnbd/static_errors_A14_t13.dart @@ -25,11 +25,7 @@ main() { a?.toString(); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'FutureOr' which excludes null. a ?.. toString(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?..' has type 'FutureOr' which excludes null. } diff --git a/LanguageFeatures/nnbd/static_errors_A17_t03.dart b/LanguageFeatures/nnbd/static_errors_A17_t03.dart index 1724afeac9..03bd6f8ac4 100644 --- a/LanguageFeatures/nnbd/static_errors_A17_t03.dart +++ b/LanguageFeatures/nnbd/static_errors_A17_t03.dart @@ -21,33 +21,20 @@ main() { foo()?.toString(); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'Never' which excludes null. foo()?.runtimeType; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'Never' which excludes null. foo()?.s = 1; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'Never' which excludes null. foo()?..toString(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'Never' which excludes null. foo()?..runtimeType; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'Never' which excludes null. foo()?..s = 1; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'Never' which excludes null. - } catch (_) {} } diff --git a/LanguageFeatures/nnbd/static_errors_A17_t04.dart b/LanguageFeatures/nnbd/static_errors_A17_t04.dart index d439d911bc..09cf0219c3 100644 --- a/LanguageFeatures/nnbd/static_errors_A17_t04.dart +++ b/LanguageFeatures/nnbd/static_errors_A17_t04.dart @@ -24,33 +24,20 @@ main() { foo()?.toString(); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'Never' which excludes null. foo()?.runtimeType; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'Never' which excludes null. foo()?.s = 1; // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'Never' which excludes null. foo()?..toString(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'Never' which excludes null. foo()?..runtimeType; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'Never' which excludes null. foo()?..s = 1; // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'Never' which excludes null. - } catch (_) {} } diff --git a/LanguageFeatures/nnbd/static_errors_A32_t01.dart b/LanguageFeatures/nnbd/static_errors_A32_t01.dart index 352b03a73e..32f09b189f 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t01.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t01.dart @@ -10,7 +10,6 @@ /// @author sgrekhov@unipro.ru /// @issue 39598 - class A { test() {} } @@ -21,29 +20,19 @@ main() { A a = A(); C c = C(); a?.test(); -//^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a?..test(); -//^ -// [cfe] Operand of null-aware operation '?..' has type 'A' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a ?? c; -//^ -// [cfe] Operand of null-aware operation '??' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION a ??= c; -//^ -// [cfe] Operand of null-aware operation '??=' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION List clist = [C(), C()]; List alist = [A(), C(), ...? clist]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. } diff --git a/LanguageFeatures/nnbd/static_errors_A32_t03.dart b/LanguageFeatures/nnbd/static_errors_A32_t03.dart index c73db54e5c..468cacd784 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t03.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t03.dart @@ -26,29 +26,19 @@ main() { a?.test(); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. a?..test(); // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -//^ -// [cfe] Operand of null-aware operation '?..' has type 'A' which excludes null. a ?? c; // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] Operand of null-aware operation '??' has type 'A' which excludes null. a ??= c; // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION -//^ -// [cfe] Operand of null-aware operation '??=' has type 'A' which excludes null. List clist = [C(), C()]; List alist = [A(), C(), ...? clist]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. } diff --git a/LanguageFeatures/nnbd/static_errors_A32_t05.dart b/LanguageFeatures/nnbd/static_errors_A32_t05.dart index 573a89240f..7f65cbd897 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t05.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t05.dart @@ -11,36 +11,25 @@ /// @issue 39598 /// @issue 39714 - void foo() {} void bar() {} main() { Function a = foo; a?.toString(); -//^ -// [cfe] Operand of null-aware operation '?.' has type 'Function' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a?..toString(); -//^ -// [cfe] Operand of null-aware operation '?..' has type 'Function' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a ?? bar; -//^ -// [cfe] Operand of null-aware operation '??' has type 'Function' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION a ??= bar; -//^ -// [cfe] Operand of null-aware operation '??=' has type 'Function' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION List clist = [foo, bar]; List alist = [foo, bar, ...? clist]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. } diff --git a/LanguageFeatures/nnbd/static_errors_A32_t06.dart b/LanguageFeatures/nnbd/static_errors_A32_t06.dart index 03488e628b..4fb649f9a8 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t06.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t06.dart @@ -11,7 +11,6 @@ /// @issue 39598 /// @issue 39714 - void foo() {} void bar() {} typedef void Foo(); @@ -19,29 +18,19 @@ typedef void Foo(); main() { Foo a = foo; a?.toString(); -//^ -// [cfe] Operand of null-aware operation '?.' has type 'void Function()' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a?..toString(); -//^ -// [cfe] Operand of null-aware operation '?..' has type 'void Function()' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a ?? bar; -//^ -// [cfe] Operand of null-aware operation '??' has type 'void Function()' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION a ??= bar; -//^ -// [cfe] Operand of null-aware operation '??=' has type 'void Function()' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION List clist = [foo, bar]; List alist = [foo, bar, ...? clist]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. } diff --git a/LanguageFeatures/nnbd/static_errors_A32_t07.dart b/LanguageFeatures/nnbd/static_errors_A32_t07.dart index 821676617c..466069edee 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t07.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t07.dart @@ -11,34 +11,23 @@ /// @issue 39598 /// @issue 39714 - test(T t) { t?.toString(); -//^ -// [cfe] Operand of null-aware operation '?.' has type 'T' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR t?..toString(); -//^ -// [cfe] Operand of null-aware operation '?..' has type 'T' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR t ?? t; -//^ -// [cfe] Operand of null-aware operation '??' has type 'T' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION t ??= t; -//^ -// [cfe] Operand of null-aware operation '??=' has type 'T' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION List clist = [t, t]; List alist = [t, t, ...? clist]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List' which excludes null. } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A32_t08.dart b/LanguageFeatures/nnbd/static_errors_A32_t08.dart index 5fb7fffffa..a33aa8a346 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t08.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t08.dart @@ -11,36 +11,25 @@ /// @issue 39598 /// @issue 39714 - import "dart:async"; test(FutureOr t) { t?.toString(); -//^ -// [cfe] Operand of null-aware operation '?.' has type 'FutureOr' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR t?..toString(); -//^ -// [cfe] Operand of null-aware operation '?..' has type 'FutureOr' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR t ?? t; -//^ -// [cfe] Operand of null-aware operation '??' has type 'FutureOr' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION t ??= t; -//^ -// [cfe] Operand of null-aware operation '??=' has type 'FutureOr' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION List> clist = [t, t]; List> alist = [t, t, ...? clist]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List>' which excludes null. } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A32_t09.dart b/LanguageFeatures/nnbd/static_errors_A32_t09.dart index 562e3682fb..2f0fab6056 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t09.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t09.dart @@ -11,7 +11,6 @@ /// @issue 39598 /// @issue 39714 - import "dart:async"; void foo() {} @@ -19,29 +18,19 @@ void foo() {} main() { FutureOr f = foo; f?.toString(); -//^ -// [cfe] Operand of null-aware operation '?.' has type 'FutureOr' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR f?..toString(); -//^ -// [cfe] Operand of null-aware operation '?..' has type 'FutureOr' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR f ?? f; -//^ -// [cfe] Operand of null-aware operation '??' has type 'FutureOr' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION f ??= f; -//^ -// [cfe] Operand of null-aware operation '??=' has type 'FutureOr' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION List> clist = [f, f]; List> alist = [f, f, ...? clist]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List>' which excludes null. } diff --git a/LanguageFeatures/nnbd/static_errors_A32_t11.dart b/LanguageFeatures/nnbd/static_errors_A32_t11.dart index e331067137..c2cf1167fe 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t11.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t11.dart @@ -12,36 +12,25 @@ /// @issue 39598 /// @issue 39714 - import "dart:async"; test(FutureOr t) { t?.toString(); -//^ -// [cfe] Operand of null-aware operation '?.' has type 'FutureOr' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR t?..toString(); -//^ -// [cfe] Operand of null-aware operation '?..' has type 'FutureOr' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR t ?? t; -//^ -// [cfe] Operand of null-aware operation '??' has type 'FutureOr' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION t ??= t; -//^ -// [cfe] Operand of null-aware operation '??=' has type 'FutureOr' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION List> clist = [t, t]; List> alist = [t, t, ...? clist]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List>' which excludes null. } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A32_t12.dart b/LanguageFeatures/nnbd/static_errors_A32_t12.dart index 0e19be8532..e1654c37a3 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t12.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t12.dart @@ -11,7 +11,6 @@ /// @issue 39598 /// @issue 39714 - import "dart:async"; class A {} @@ -19,29 +18,19 @@ class A {} main() { FutureOr> a = new A(); a?.toString(); -//^ -// [cfe] Operand of null-aware operation '?.' has type 'FutureOr>' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a?..toString(); -//^ -// [cfe] Operand of null-aware operation '?..' has type 'FutureOr>' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a ?? a; -//^ -// [cfe] Operand of null-aware operation '??' has type 'FutureOr>' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION a ??= a; -//^ -// [cfe] Operand of null-aware operation '??=' has type 'FutureOr>' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION List>> clist = [a, a]; List>> alist = [a, a, ...? clist]; // ^^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '...?' has type 'List>>' which excludes null. } diff --git a/LanguageFeatures/nnbd/static_errors_A32_t13.dart b/LanguageFeatures/nnbd/static_errors_A32_t13.dart index 19d81cc420..f68d1f173a 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t13.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t13.dart @@ -11,7 +11,6 @@ /// @issue 39598 /// @issue 39714 - class A { } class C extends A {} @@ -19,23 +18,15 @@ class C extends A {} test(var a, C c) { if (a is Object) { a?.toString(); -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'Object' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a?..toString(); -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'Object' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a ?? c; -// ^ -// [cfe] Operand of null-aware operation '??' has type 'Object' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION a ??= c; -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'Object' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION } diff --git a/LanguageFeatures/nnbd/static_errors_A32_t14.dart b/LanguageFeatures/nnbd/static_errors_A32_t14.dart index 6c517fb7ad..af9a70ea2a 100644 --- a/LanguageFeatures/nnbd/static_errors_A32_t14.dart +++ b/LanguageFeatures/nnbd/static_errors_A32_t14.dart @@ -11,7 +11,6 @@ /// @issue 39598 /// @issue 39714 - class A { } class C extends A {} @@ -21,23 +20,15 @@ main() { C c = C(); if (a != null) { a?.toString(); -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'A' which excludes null. // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a?..toString(); -// ^ -// [cfe] Operand of null-aware operation '?..' has type 'A' which excludes null. // ^^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR a ?? c; -// ^ -// [cfe] Operand of null-aware operation '??' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION a ??= c; -// ^ -// [cfe] Operand of null-aware operation '??=' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.DEAD_NULL_AWARE_EXPRESSION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t01.dart b/LanguageFeatures/nnbd/static_errors_A33_t01.dart index 681888cd65..2b3d97b8f5 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t01.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t01.dart @@ -10,11 +10,8 @@ /// @author sgrekhov@unipro.ru /// @issue 39598 - test (Never n) { n!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'Never' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t02.dart b/LanguageFeatures/nnbd/static_errors_A33_t02.dart index fdd307c413..7956ca774e 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t02.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t02.dart @@ -10,22 +10,17 @@ /// @author sgrekhov@unipro.ru /// @issue 39598 - void foo() {} typedef void Foo(); main() { Function f1 = foo; f1!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'Function' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION Foo f2 = foo; f2!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'void Function()' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t03.dart b/LanguageFeatures/nnbd/static_errors_A33_t03.dart index 39936a52e1..342ee45e3e 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t03.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t03.dart @@ -10,14 +10,11 @@ /// @author sgrekhov@unipro.ru /// @issue 39598 - class A {} main() { A a = new A(); a!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t05.dart b/LanguageFeatures/nnbd/static_errors_A33_t05.dart index 55d6b6b8b9..60e92281d6 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t05.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t05.dart @@ -10,11 +10,8 @@ /// @author sgrekhov@unipro.ru /// @issue 39598 - test(T t) { t!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'T' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t06.dart b/LanguageFeatures/nnbd/static_errors_A33_t06.dart index 620956e62c..b52203453d 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t06.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t06.dart @@ -11,14 +11,11 @@ /// @issue 39598 /// @issue 39867 - class A {} test(var a) { if (a is Object) { a!; -// ^ -// [cfe] Operand of null-aware operation '!' has type 'Object' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t07.dart b/LanguageFeatures/nnbd/static_errors_A33_t07.dart index 6eb29b34cd..25c70e34c0 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t07.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t07.dart @@ -11,15 +11,12 @@ /// @issue 39598 /// @issue 39867 - class A {} main() { A? a = new A(); if (a != null) { a!; -// ^ -// [cfe] Operand of null-aware operation '!' has type 'A' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t08.dart b/LanguageFeatures/nnbd/static_errors_A33_t08.dart index a6e4983ded..60896501ab 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t08.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t08.dart @@ -10,13 +10,10 @@ /// @author sgrekhov@unipro.ru /// @issue 39598 - import "dart:async"; test(FutureOr n) { n!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'FutureOr' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t10.dart b/LanguageFeatures/nnbd/static_errors_A33_t10.dart index 5daf19fc90..af826062fe 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t10.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t10.dart @@ -10,7 +10,6 @@ /// @author sgrekhov@unipro.ru /// @issue 39598 - import "dart:async"; class A {} @@ -18,8 +17,6 @@ class A {} main() { FutureOr a = new A(); a!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'FutureOr' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t12.dart b/LanguageFeatures/nnbd/static_errors_A33_t12.dart index fee84968cb..b62d2b57f0 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t12.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t12.dart @@ -10,7 +10,6 @@ /// @author sgrekhov@unipro.ru /// @issue 39598 - import "dart:async"; class A {} @@ -18,8 +17,6 @@ class A {} main() { FutureOr> a = new A(); a!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'FutureOr>' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/static_errors_A33_t13.dart b/LanguageFeatures/nnbd/static_errors_A33_t13.dart index d37fefe0cc..1d9ea8ddb0 100644 --- a/LanguageFeatures/nnbd/static_errors_A33_t13.dart +++ b/LanguageFeatures/nnbd/static_errors_A33_t13.dart @@ -10,48 +10,33 @@ /// type /// @author sgrekhov@unipro.ru - void foo() {} typedef void Foo(); main() { Function f1 = foo; f1!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'Function' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION Foo f2 = foo; f2!; -//^ -// [cfe] Operand of null-aware operation '!' has type 'void Function()' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION foo!(); -//^ -// [cfe] Operand of null-aware operation '!' has type 'void Function()' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION foo!(); -//^ -// [cfe] Operand of null-aware operation '!' has type 'void Function()' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION f1!(); -//^ -// [cfe] Operand of null-aware operation '!' has type 'Function' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION f1!(); -//^ -// [cfe] Operand of null-aware operation '!' has type 'Function' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION f2!(); -//^ -// [cfe] Operand of null-aware operation '!' has type 'void Function()' which excludes null. // ^ // [analyzer] STATIC_WARNING.UNNECESSARY_NON_NULL_ASSERTION } diff --git a/LanguageFeatures/nnbd/syntax_A06_t01.dart b/LanguageFeatures/nnbd/syntax_A06_t01.dart index 979b77c11f..e372cd1c00 100644 --- a/LanguageFeatures/nnbd/syntax_A06_t01.dart +++ b/LanguageFeatures/nnbd/syntax_A06_t01.dart @@ -27,6 +27,4 @@ main() { Expect.equals(4, c?[2]); // ^^ // [analyzer] STATIC_WARNING.INVALID_NULL_AWARE_OPERATOR -// ^ -// [cfe] Operand of null-aware operation '?.' has type 'C' which excludes null. }