diff --git a/LanguageFeatures/nnbd/static_errors_A06_t01.dart b/LanguageFeatures/nnbd/static_errors_A06_t01.dart index a69e65aa4c..74e97c2922 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t01.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t01.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test Never +/// non-nullable type and no initializing expression. Test type `Never`. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - class C { Never n; // ^ @@ -34,5 +34,5 @@ class D implements C { } main() { - new C.f(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t02.dart b/LanguageFeatures/nnbd/static_errors_A06_t02.dart index d04a3c241b..c9d36c3a62 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t02.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t02.dart @@ -3,17 +3,17 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test Never +/// non-nullable type and no initializing expression. Test type `Never`. /// @author sgrekhov@unipro.ru /// @issue 40940 - class A {} mixin M on A { @@ -23,9 +23,6 @@ mixin M on A { // [cfe] unspecified } -class C extends A with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t03.dart b/LanguageFeatures/nnbd/static_errors_A06_t03.dart index 8f023f5550..4c9a9d5b8f 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t03.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t03.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test Function +/// non-nullable type and no initializing expression. Test type `Function`. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - void foo() {} class C { @@ -31,5 +31,5 @@ class D implements C { } main() { - new C.f(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t04.dart b/LanguageFeatures/nnbd/static_errors_A06_t04.dart index 45f306a5b2..32bc5891ae 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t04.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t04.dart @@ -3,17 +3,17 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test Function +/// non-nullable type and no initializing expression. Test type `Function`. /// @author sgrekhov@unipro.ru /// @issue 40940 - class A {} mixin M on A { @@ -23,9 +23,6 @@ mixin M on A { // [cfe] unspecified } -class C extends A with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t05.dart b/LanguageFeatures/nnbd/static_errors_A06_t05.dart index 0dd3245425..5a0ef41e30 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t05.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t05.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test function type +/// non-nullable type and no initializing expression. Test a function type. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - typedef void Foo(); void foo() {} @@ -33,5 +33,5 @@ class D implements C { } main() { - new C.f(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t06.dart b/LanguageFeatures/nnbd/static_errors_A06_t06.dart index 048bf4c5a3..7556698694 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t06.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t06.dart @@ -3,17 +3,17 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test function type +/// non-nullable type and no initializing expression. Test a function type. /// @author sgrekhov@unipro.ru /// @issue 40940 - typedef void Foo(); class A {} @@ -25,9 +25,6 @@ mixin M on A { // [cfe] unspecified } -class C extends A with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t07.dart b/LanguageFeatures/nnbd/static_errors_A06_t07.dart index 59630fe4a2..aaa36ec41a 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t07.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t07.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test some class X +/// non-nullable type and no initializing expression. Test some class. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - class X {} class C { @@ -31,5 +31,5 @@ class D implements C { } main() { - new C.f(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t08.dart b/LanguageFeatures/nnbd/static_errors_A06_t08.dart index ebb640fb4e..8d1abbff9e 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t08.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t08.dart @@ -3,18 +3,17 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test some class X +/// non-nullable type and no initializing expression. Test some class. /// @author sgrekhov@unipro.ru /// @issue 40940 - - class A {} class X {} @@ -25,9 +24,6 @@ mixin M on A { // [cfe] unspecified } -class C extends A with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t11.dart b/LanguageFeatures/nnbd/static_errors_A06_t11.dart index 7ac3ad0189..9e0d522334 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t11.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t11.dart @@ -3,19 +3,19 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test some type -/// +/// non-nullable type and no initializing expression. Test some type +/// ``. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - class C { X x; // ^ diff --git a/LanguageFeatures/nnbd/static_errors_A06_t12.dart b/LanguageFeatures/nnbd/static_errors_A06_t12.dart index bc25351c51..73abd2e34f 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t12.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t12.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test some type -/// +/// non-nullable type and no initializing expression. Test some type +/// ``. /// @author sgrekhov@unipro.ru /// @issue 40940 - class X {} mixin M on X { @@ -24,9 +24,6 @@ mixin M on X { // [cfe] unspecified } -class C extends X with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t13.dart b/LanguageFeatures/nnbd/static_errors_A06_t13.dart index 25b13ec31e..d43ee1cb85 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t13.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t13.dart @@ -3,19 +3,19 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test some type -/// +/// non-nullable type and no initializing expression. Test some type +/// ``. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - class C { X x; // ^ @@ -30,5 +30,5 @@ class D implements C { } main() { - new C.f("Lily was here"); + print(C)l } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t14.dart b/LanguageFeatures/nnbd/static_errors_A06_t14.dart index dfe78b41f1..7f716e7ff6 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t14.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t14.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test some type -/// +/// non-nullable type and no initializing expression. Test some type +/// ``. /// @author sgrekhov@unipro.ru /// @issue 40940 - class X {} mixin M on X { @@ -28,5 +28,5 @@ class C extends X with M { } main() { - new C(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t15.dart b/LanguageFeatures/nnbd/static_errors_A06_t15.dart index d52e0f39c2..5c4428c557 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t15.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t15.dart @@ -3,18 +3,19 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test FutureOr +/// non-nullable type and no initializing expression. Test type +/// `FutureOr`. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - import "dart:async"; class C { @@ -36,5 +37,5 @@ class D implements C { } main() { - new C.f(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t16.dart b/LanguageFeatures/nnbd/static_errors_A06_t16.dart index 33eccea54a..ce198609d4 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t16.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t16.dart @@ -3,17 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test FutureOr +/// non-nullable type and no initializing expression. Test type +/// `FutureOr`. /// @author sgrekhov@unipro.ru /// @issue 40940 - import "dart:async"; class X {} @@ -25,9 +26,6 @@ mixin M on X { // [cfe] unspecified } -class C extends X with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t17.dart b/LanguageFeatures/nnbd/static_errors_A06_t17.dart index fb1b62aec6..9ca457bb4c 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t17.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t17.dart @@ -3,19 +3,19 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test FutureOr where -/// F is a function type +/// non-nullable type and no initializing expression. Test `FutureOr` where +/// `F` is a function type /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - import "dart:async"; typedef void Foo(); @@ -42,5 +42,5 @@ class D implements C { } main() { - new C.f(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t18.dart b/LanguageFeatures/nnbd/static_errors_A06_t18.dart index c03fe08b10..b82f966efc 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t18.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t18.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test FutureOr where -/// F is a function type +/// non-nullable type and no initializing expression. Test `FutureOr` where +/// `F` is a function type. /// @author sgrekhov@unipro.ru /// @issue 40940 - import "dart:async"; typedef void Foo(); @@ -32,9 +32,6 @@ mixin M on X { // [cfe] unspecified } -class C extends X with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t19.dart b/LanguageFeatures/nnbd/static_errors_A06_t19.dart index abf4f39732..96fe8c1b2f 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t19.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t19.dart @@ -3,19 +3,19 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test FutureOr where -/// A is some class +/// non-nullable type and no initializing expression. Test type `FutureOr` +/// where `A` is some class. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - import "dart:async"; class A {} @@ -36,5 +36,5 @@ class D implements C { } main() { - new C.f(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t20.dart b/LanguageFeatures/nnbd/static_errors_A06_t20.dart index 624d7b486c..7d6168c62b 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t20.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t20.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test FutureOr where -/// A is some class +/// non-nullable type and no initializing expression. Test `FutureOr` where +/// `A` is some class. /// @author sgrekhov@unipro.ru /// @issue 40940 - import "dart:async"; class A {} @@ -27,9 +27,6 @@ mixin M on X { // [cfe] unspecified } -class C extends X with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t23.dart b/LanguageFeatures/nnbd/static_errors_A06_t23.dart index e5b7745765..2160ac5350 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t23.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t23.dart @@ -3,19 +3,19 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test FutureOr, where -/// +/// non-nullable type and no initializing expression. Test type `FutureOr`, +/// where ``. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - import "dart:async"; class C { @@ -32,5 +32,5 @@ class D implements C { } main() { - new C.f("Lily was here"); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t24.dart b/LanguageFeatures/nnbd/static_errors_A06_t24.dart index d944f75ca1..5aad4ff177 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t24.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t24.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test FutureOr, where -/// +/// non-nullable type and no initializing expression. Test type `FutureOr`, +/// where ``. /// @author sgrekhov@unipro.ru /// @issue 40940 - import "dart:async"; class X {} @@ -26,9 +26,6 @@ mixin M on X { // [cfe] unspecified } -class C extends X with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t25.dart b/LanguageFeatures/nnbd/static_errors_A06_t25.dart index 44856d1efb..cf48adcf25 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t25.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t25.dart @@ -3,19 +3,19 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a class declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test -/// FutureOr> where A is some class +/// non-nullable type and no initializing expression. Test type +/// `FutureOr>` where `A` is some class. /// @author sgrekhov@unipro.ru /// @issue 40677 /// @issue 40940 - import "dart:async"; class A {} @@ -35,5 +35,5 @@ class D implements C { } main() { - new C.f(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t26.dart b/LanguageFeatures/nnbd/static_errors_A06_t26.dart index 9996086935..d8532219a0 100644 --- a/LanguageFeatures/nnbd/static_errors_A06_t26.dart +++ b/LanguageFeatures/nnbd/static_errors_A06_t26.dart @@ -3,18 +3,18 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a mixin declaration or a class declaration with -/// no generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression unless the variable is marked -/// with the late modifier. +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. /// /// @description Check that it is an error if a mixin declaration with no /// generative constructors declares an instance variable with a potentially -/// non-nullable type and no initializer expression. Test -/// FutureOr> where A is some class +/// non-nullable type and no initializer expression. Test type +/// `FutureOr>` where `A` is some class. /// @author sgrekhov@unipro.ru /// @issue 40940 - import "dart:async"; class A {} @@ -27,9 +27,6 @@ mixin M on X { // [cfe] unspecified } -class C extends X with M { -} - main() { - new C(); + print(M); } diff --git a/LanguageFeatures/nnbd/static_errors_A06_t27.dart b/LanguageFeatures/nnbd/static_errors_A06_t27.dart new file mode 100644 index 0000000000..7c456665e6 --- /dev/null +++ b/LanguageFeatures/nnbd/static_errors_A06_t27.dart @@ -0,0 +1,73 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion It is an error if a mixin declaration or a class declaration with +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. +/// +/// @description Check that it is an error if a mixin declaration or a class +/// declaration with no generative constructors declares an instance variable +/// without an initializing expression which is final. +/// @author sgrekhov22@gmail.com + +class C { + final v1; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final dynamic v2; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final Object? v3; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final Null v4; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final void v5; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final T? v6; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified +} + +mixin M { + final v1; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final dynamic v2; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final Object? v3; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final Null v4; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final void v5; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified + final T? v6; +// ^^ +// [analyzer] unspecified +// [cfe] unspecified +} + +main() { + print(C); + print(M); +} diff --git a/LanguageFeatures/nnbd/static_errors_A06_t28.dart b/LanguageFeatures/nnbd/static_errors_A06_t28.dart new file mode 100644 index 0000000000..48408358c6 --- /dev/null +++ b/LanguageFeatures/nnbd/static_errors_A06_t28.dart @@ -0,0 +1,44 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion It is an error if a mixin declaration or a class declaration with +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. +/// +/// @description Check that it is not an error if a mixin declaration or a class +/// declaration with no generative constructors declares an instance variable +/// without an initializing expression which is final but it is marked with +/// `late`, `abstract` or `external`. +/// @author sgrekhov22@gmail.com + +abstract class C { + late final v1; + late final Object v2; + late final T v3; + abstract final v4; + abstract final Object v5; + abstract final T v6; + external final v7; + external final Object v8; + external final T v9; +} + +mixin M { + late final v1; + late final Object v2; + late final T v3; + abstract final v4; + abstract final Object v5; + abstract final T v6; + external final v7; + external final Object v8; + external final T v9; +} + +main() { + print(C); + print(M); +} diff --git a/LanguageFeatures/nnbd/static_errors_A06_t29.dart b/LanguageFeatures/nnbd/static_errors_A06_t29.dart new file mode 100644 index 0000000000..bef441dc9a --- /dev/null +++ b/LanguageFeatures/nnbd/static_errors_A06_t29.dart @@ -0,0 +1,38 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// @assertion It is an error if a mixin declaration or a class declaration with +/// no generative constructors declares an instance variable without an +/// initializing expression which is final or whose type is potentially +/// non-nullable, unless the variable is marked with a `late`, `abstract`, or +/// `external` modifier. +/// +/// @description Check that it is not an error if a mixin declaration or a class +/// declaration with no generative constructors declares an instance variable +/// without an initializing expression whose type is potentially non-nullable +/// but it is marked with `late`, `abstract` or `external`. +/// @author sgrekhov22@gmail.com + +abstract class C { + late Object v1; + late T v2; + abstract Object v3; + abstract T v4; + external Object v5; + external T v6; +} + +mixin M { + late Object v1; + late T v2; + abstract Object v3; + abstract T v4; + external Object v5; + external T v6; +} + +main() { + print(C); + print(M); +}