diff --git a/LanguageFeatures/nnbd/static_errors_A04_t01.dart b/LanguageFeatures/nnbd/static_errors_A04_t01.dart index 07a35812fa..8174ea5d8f 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t01.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t01.dart @@ -3,15 +3,14 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is an error if a top level variable or static -/// variable with a non-nullable type has no initializer expression unless the -/// variable is marked with the `late` modifier. Test Never +/// @description Check that it is an error if a top level or static variable +/// with a non-nullable type has no initializer expression and is not marked +/// with a `late` or `external `modifier. Test type `Never`. /// @author sgrekhov@unipro.ru - Never n; // ^ // [analyzer] unspecified @@ -25,5 +24,5 @@ class C { } main() { - new C(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A04_t02.dart b/LanguageFeatures/nnbd/static_errors_A04_t02.dart index 80553bbccc..d227a9fe91 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t02.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t02.dart @@ -3,15 +3,14 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is an error if a top level variable or static -/// variable with a non-nullable type has no initializer expression unless the -/// variable is marked with the `late` modifier. Test Function +/// @description Check that it is an error if a top level or static variable +/// with a non-nullable type has no initializer expression and is not marked +/// with a `late` or `external `modifier. Test type `Function`. /// @author sgrekhov@unipro.ru - Function f; // ^ // [analyzer] unspecified @@ -25,5 +24,5 @@ class C { } main() { - new C(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A04_t03.dart b/LanguageFeatures/nnbd/static_errors_A04_t03.dart index 0445816993..aa8c4e693b 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t03.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t03.dart @@ -3,15 +3,14 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is an error if a top level variable or static -/// variable with a non-nullable type has no initializer expression unless the -/// variable is marked with the `late` modifier. Test function type +/// @description Check that it is an error if a top level or static variable +/// with a non-nullable type has no initializer expression and is not marked +/// with a `late` or `external `modifier. Test a function type. /// @author sgrekhov@unipro.ru - typedef void Foo(); Foo f; @@ -27,5 +26,5 @@ class C { } main() { - new C(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A04_t04.dart b/LanguageFeatures/nnbd/static_errors_A04_t04.dart index a4f45f4243..2fb5c1307f 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t04.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t04.dart @@ -3,15 +3,14 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is an error if a top level variable or static -/// variable with a non-nullable type has no initializer expression unless the -/// variable is marked with the `late` modifier. Test some class A +/// @description Check that it is an error if a top level or static variable +/// with a non-nullable type has no initializer expression and is not marked +/// with a `late` or `external `modifier. Test some class. /// @author sgrekhov@unipro.ru - class A {} A a; @@ -35,5 +34,5 @@ class C { } main() { - new C(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A04_t08.dart b/LanguageFeatures/nnbd/static_errors_A04_t08.dart index 447105061b..10b5358afb 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t08.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t08.dart @@ -3,15 +3,14 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is an error if a top level variable or static -/// variable with a non-nullable type has no initializer expression unless the -/// variable is marked with the `late` modifier. Test FutureOr +/// @description Check that it is an error if a top level or static variable +/// with a non-nullable type has no initializer expression and is not marked +/// with a `late` or `external `modifier. Test type `FutureOr`. /// @author sgrekhov@unipro.ru - import "dart:async"; FutureOr n; @@ -27,5 +26,5 @@ class C { } main() { - new C(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A04_t09.dart b/LanguageFeatures/nnbd/static_errors_A04_t09.dart index 0863d0aef8..6a922dbe5d 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t09.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t09.dart @@ -3,16 +3,15 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is an error if a top level variable or static -/// variable with a non-nullable type has no initializer expression unless the -/// variable is marked with the `late` modifier. Test FutureOr where F is -/// a function type +/// @description Check that it is an error if a top level or static variable +/// with a non-nullable type has no initializer expression and is not marked +/// with a `late` or `external `modifier. Test type `FutureOr` where `F` is a +/// function type. /// @author sgrekhov@unipro.ru - import "dart:async"; typedef void Foo(); @@ -40,5 +39,5 @@ class C { } main() { - new C(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A04_t10.dart b/LanguageFeatures/nnbd/static_errors_A04_t10.dart index 7d8314caaa..f19db9fbe5 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t10.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t10.dart @@ -3,16 +3,15 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is an error if a top level variable or static -/// variable with a non-nullable type has no initializer expression unless the -/// variable is marked with the `late` modifier. Test FutureOr where A is -/// some class +/// @description Check that it is an error if a top level or static variable +/// with a non-nullable type has no initializer expression and is not marked +/// with a `late` or `external `modifier. Test type `FutureOr` where `A` is +/// some class. /// @author sgrekhov@unipro.ru - import "dart:async"; class A {} @@ -40,5 +39,5 @@ class C { } main() { - new C(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A04_t13.dart b/LanguageFeatures/nnbd/static_errors_A04_t13.dart index 6bf0f2d3ad..e3322f839c 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t13.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t13.dart @@ -3,16 +3,15 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is an error if a top level variable or static -/// variable with a non-nullable type has no initializer expression unless the -/// variable is marked with the `late` modifier. Test FutureOr> -/// where A is some class +/// @description Check that it is an error if a top level or static variable +/// with a non-nullable type has no initializer expression and is not marked +/// with a `late` or `external `modifier. Test `FutureOr>` where `A` +/// is some class. /// @author sgrekhov@unipro.ru - import "dart:async"; class A {} @@ -40,5 +39,5 @@ class C { } main() { - new C(); + print(C); } diff --git a/LanguageFeatures/nnbd/static_errors_A04_t21.dart b/LanguageFeatures/nnbd/static_errors_A04_t21.dart index 0b4fe0c424..2f03716312 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t21.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t21.dart @@ -3,22 +3,26 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is not an error if a top level or static -/// variable with potentially non-nullable type has no initializer expression -/// but marked with a 'late' modifier. Test Never +/// @description Check that it is not an error if a top level or static variable +/// with a non-nullable type has no initializer expression but is marked with a +/// `late` or `external `modifier. Test type `Never`. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong -late Never n; + +late Never n1; +external Never n2; class C { static late Never n1; static late final Never n2; + external static Never n3; + external static final Never n4; } main() { - new C(); + C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A04_t22.dart b/LanguageFeatures/nnbd/static_errors_A04_t22.dart index 74f781d749..4378b75c9c 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t22.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t22.dart @@ -3,21 +3,24 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is not an error if a top level or static -/// variable with potentially non-nullable type has no initializer expression -/// but marked with a 'late' modifier. Test Function +/// @description Check that it is not an error if a top level or static variable +/// with a non-nullable type has no initializer expression but is marked with a +/// `late` or `external `modifier. Test type `Function`. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong -late Function x; +late Function x1; +external Function x2; class C { static late Function x1; static late final Function x2; + external static Function x3; + external static final Function x4; } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A04_t23.dart b/LanguageFeatures/nnbd/static_errors_A04_t23.dart index ca5176768d..77f56059b5 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t23.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t23.dart @@ -3,22 +3,26 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is not an error if a top level or static -/// variable with potentially non-nullable type has no initializer expression -/// but marked with a 'late' modifier. Test function type +/// @description Check that it is not an error if a top level or static variable +/// with a non-nullable type has no initializer expression but is marked with a +/// `late` or `external `modifier. Test a function type. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + typedef void Foo(); -late Foo x; +late Foo x1; +external Foo x2; class C { static late Foo x1; static late final Foo x2; + external static Foo x3; + external static final Foo x4; } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A04_t24.dart b/LanguageFeatures/nnbd/static_errors_A04_t24.dart index 0c090d64f4..7873238963 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t24.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t24.dart @@ -3,22 +3,26 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is not an error if a top level or static -/// variable with potentially non-nullable type has no initializer expression -/// but marked with a 'late' modifier. Test some class A +/// @description Check that it is not an error if a top level or static variable +/// with a non-nullable type has no initializer expression but is marked with a +/// `late` or `external `modifier. Test some class. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + class A {} -late A x; +late A x1; +external A x2; class C { static late A x1; static late final A x2; + external static A x3; + external static final A x4; } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A04_t28.dart b/LanguageFeatures/nnbd/static_errors_A04_t28.dart index 887a0e52b5..b28d219c82 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t28.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t28.dart @@ -3,21 +3,26 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is not an error if a top level or static -/// variable with potentially non-nullable type has no initializer expression -/// but marked with a 'late' modifier. Test FutureOr +/// @description Check that it is not an error if a top level or static variable +/// with a non-nullable type has no initializer expression but is marked with a +/// `late` or `external `modifier. Test type `FutureOr`. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; -late FutureOr x; + +late FutureOr x1; +external FutureOr x2; class C { static late FutureOr x1; static late final FutureOr x2; + external static FutureOr x3; + external static final FutureOr x4; } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A04_t29.dart b/LanguageFeatures/nnbd/static_errors_A04_t29.dart index f0acefb6f1..d6a317b247 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t29.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t29.dart @@ -3,28 +3,36 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is not an error if a top level or static -/// variable with potentially non-nullable type has no initializer expression -/// but marked with a 'late' modifier. Test FutureOr where F is a function -/// type +/// @description Check that it is not an error if a top level or static variable +/// with a non-nullable type has no initializer expression but is marked with a +/// `late` or `external `modifier. Test `FutureOr` where `F` is a function +/// type. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; + typedef void Foo(); late FutureOr f1; late FutureOr f2; +external FutureOr f3; +external FutureOr f4; class C { static late FutureOr x1; static late final FutureOr x2; - static late FutureOr x3; static late final FutureOr x4; + + external static FutureOr x5; + external static final FutureOr x6; + external static FutureOr x7; + external static final FutureOr x8; } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A04_t30.dart b/LanguageFeatures/nnbd/static_errors_A04_t30.dart index 41a99a730b..a89e4529c5 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t30.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t30.dart @@ -3,23 +3,28 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is not an error if a top level or static -/// variable with potentially non-nullable type has no initializer expression -/// but marked with a 'late' modifier. Test FutureOr where A is some class +/// @description Check that it is not an error if a top level or static variable +/// with a non-nullable type has no initializer expression but is marked with a +/// `late` or `external `modifier. Test `FutureOr` where `A` is some class. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; + class A {} -late FutureOr x; +late FutureOr x1; +external FutureOr x2; class C { static late FutureOr x1; static late final FutureOr x2; + external static FutureOr x3; + external static final FutureOr x4; } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A04_t33.dart b/LanguageFeatures/nnbd/static_errors_A04_t33.dart index aa66717577..22a80a04a6 100644 --- a/LanguageFeatures/nnbd/static_errors_A04_t33.dart +++ b/LanguageFeatures/nnbd/static_errors_A04_t33.dart @@ -3,24 +3,29 @@ // BSD-style license that can be found in the LICENSE file. /// @assertion It is an error if a top level variable or static variable with a -/// non-nullable type has no initializer expression unless the variable is marked -/// with the `late` modifier. +/// non-nullable type has no initializer expression unless the variable is +/// marked with a `late` or `external` modifier. /// -/// @description Check that it is not an error if a top level or static -/// variable with potentially non-nullable type has no initializer expression -/// but marked with a 'late' modifier. Test FutureOr> where A is some -/// class +/// @description Check that it is not an error if a top level or static variable +/// with a non-nullable type has no initializer expression but is marked with a +/// `late` or `external `modifier. Test `FutureOr>` where `A` is +/// some class. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; + class A {} -late FutureOr> x; +late FutureOr> x1; +external FutureOr> x2; class C { static late FutureOr> x1; static late final FutureOr> x2; + external static FutureOr> x3; + external static final FutureOr> x4; } main() { diff --git a/LanguageFeatures/nnbd/static_errors_A05_t01.dart b/LanguageFeatures/nnbd/static_errors_A05_t01.dart index 24cde5df95..59c7809dd0 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t01.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t01.dart @@ -6,17 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test Never +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test type `Never`. /// @author sgrekhov@unipro.ru /// @issue 40951 - class C1 { Never n; // ^ @@ -33,12 +33,9 @@ abstract class C2 { C2() {} //^^ // [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD - } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t02.dart b/LanguageFeatures/nnbd/static_errors_A05_t02.dart index a662432bb7..ddf8d6449e 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t02.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t02.dart @@ -6,13 +6,14 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description It is an error if a class declaration declares an instance -/// variable with a potentially non-nullable type and no initializer expression, -/// and the class has a generative constructor where the variable is not -/// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. Test Function +/// @description Check that it is an error if a class declaration declares an +/// instance variable with a potentially non-nullable type and no initializer +/// expression, and the class has a generative constructor where the variable is +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test type `Function`. /// @author sgrekhov@unipro.ru /// @issue 40951 @@ -36,9 +37,7 @@ abstract class C2 { // [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t03.dart b/LanguageFeatures/nnbd/static_errors_A05_t03.dart index a1e2c43b8d..e300bfaa56 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t03.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t03.dart @@ -6,17 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test function type +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test a function type. /// @author sgrekhov@unipro.ru /// @issue 40951 - typedef void Foo(); class C1 { @@ -26,7 +26,6 @@ class C1 { C1() {} //^^ // [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD - } abstract class C2 { @@ -38,9 +37,7 @@ abstract class C2 { // [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t04.dart b/LanguageFeatures/nnbd/static_errors_A05_t04.dart index 6a98f61d12..2e0c48a11a 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t04.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t04.dart @@ -6,17 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test some class A +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test some class. /// @author sgrekhov@unipro.ru /// @issue 40951 - class A {} class C1 { @@ -47,9 +47,7 @@ abstract class C2 { // [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t06.dart b/LanguageFeatures/nnbd/static_errors_A05_t06.dart index ad13508108..d2c9ee5bc8 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t06.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t06.dart @@ -6,18 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test some type -/// +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test type ``. /// @author sgrekhov@unipro.ru /// @issue 40951 - class C1 { X x; // ^ @@ -36,9 +35,7 @@ abstract class C2 { // [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t07.dart b/LanguageFeatures/nnbd/static_errors_A05_t07.dart index 288d85a7e4..53320f0ba0 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t07.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t07.dart @@ -6,18 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test some type -/// +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test type ``. /// @author sgrekhov@unipro.ru /// @issue 40951 - class C1 { X x; // ^ @@ -36,9 +35,7 @@ abstract class C2 { // [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t08.dart b/LanguageFeatures/nnbd/static_errors_A05_t08.dart index e8ab0880a0..71884a81d1 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t08.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t08.dart @@ -6,17 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test FutureOr +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test type `FutureOr`. /// @author sgrekhov@unipro.ru /// @issue 40951 - import "dart:async"; class C1 { diff --git a/LanguageFeatures/nnbd/static_errors_A05_t09.dart b/LanguageFeatures/nnbd/static_errors_A05_t09.dart index d47acf86c4..0d985f8378 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t09.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t09.dart @@ -6,18 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test FutureOr where -/// F is a function type +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test `FutureOr` where `F` is a function type. /// @author sgrekhov@unipro.ru /// @issue 40951 - import "dart:async"; typedef void Foo(); @@ -32,9 +31,7 @@ class C1 { C1() {} //^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD -//^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD +// [analyzer] unspecified } abstract class C2 { @@ -47,14 +44,10 @@ abstract class C2 { C2() {} //^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD -//^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD +// [analyzer] unspecified } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t10.dart b/LanguageFeatures/nnbd/static_errors_A05_t10.dart index 311cd9275a..0a3e4d9bd6 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t10.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t10.dart @@ -6,18 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test FutureOr where -/// A is some class +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test `FutureOr` where `A` is some class. /// @author sgrekhov@unipro.ru /// @issue 40951 - import "dart:async"; class A {} @@ -31,9 +30,7 @@ class C1 { // [cfe] unspecified C1() {} //^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD -//^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD +// [analyzer] unspecified } abstract class C2 { @@ -45,14 +42,10 @@ abstract class C2 { // [cfe] unspecified C2() {} //^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD -//^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD +// [analyzer] unspecified } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t12.dart b/LanguageFeatures/nnbd/static_errors_A05_t12.dart index 56b165c56b..ab486a7640 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t12.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t12.dart @@ -6,18 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test FutureOr, where -/// +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test `FutureOr`, where ``. /// @author sgrekhov@unipro.ru /// @issue 40951 - import "dart:async"; class C1 { @@ -26,7 +25,7 @@ class C1 { // [cfe] unspecified C1() {} //^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD +// [analyzer] unspecified } abstract class C2 { @@ -35,12 +34,10 @@ abstract class C2 { // [cfe] unspecified C2() {} //^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD +// [analyzer] unspecified } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t13.dart b/LanguageFeatures/nnbd/static_errors_A05_t13.dart index 97849cc0c6..bb50d865a6 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t13.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t13.dart @@ -6,18 +6,17 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// /// @description Check that it is an error if a class declaration declares an /// instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test -/// FutureOr> where A is some class +/// not initialized via an initializing formal or an initializer list entry, and +/// the variable is not marked with a `late`, `abstract` or `external` modifier. +/// Test `FutureOr>` where `A` is some class. /// @author sgrekhov@unipro.ru /// @issue 40951 - import "dart:async"; class A {} @@ -31,9 +30,7 @@ class C1 { // [cfe] unspecified C1() {} //^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD -//^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD +// [analyzer] unspecified } abstract class C2 { @@ -46,14 +43,10 @@ abstract class C2 { C2() {} //^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD -//^^ -// [analyzer] COMPILE_TIME_ERROR.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD +// [analyzer] unspecified } -class C3 extends C2 {} - main() { - new C1(); - new C3(); + print(C1); + print(C2); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t15.dart b/LanguageFeatures/nnbd/static_errors_A05_t15.dart index c396685968..d98503a310 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t15.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t15.dart @@ -6,15 +6,16 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is no compile-time error if an instance variable -/// with a potentially non-nullable type has no initializer expression but -/// initialized in a constructor via an initializing formal or an initializer -/// list entry. Test Function types +/// @description Check that it is no error if an instance variable with a +/// potentially non-nullable type has no initializer expression but initialized +/// in a constructor via an initializing formal or an initializer list entry. +/// Test `Function` types /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + typedef void Foo(); class A { diff --git a/LanguageFeatures/nnbd/static_errors_A05_t16.dart b/LanguageFeatures/nnbd/static_errors_A05_t16.dart index d864eac926..063e702020 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t16.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t16.dart @@ -6,15 +6,16 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is no compile-time error if an instance variable -/// with a potentially non-nullable type has no initializer expression but -/// initialized in a constructor via an initializing formal or an initializer -/// list entry. Test some class A +/// @description Check that it is no error if an instance variable with a +/// potentially non-nullable type has no initializer expression but initialized +/// in a constructor via an initializing formal or an initializer list entry. +/// Test some class `A`. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + class A {} class C1 { diff --git a/LanguageFeatures/nnbd/static_errors_A05_t17.dart b/LanguageFeatures/nnbd/static_errors_A05_t17.dart index 0a9481a48d..f5bb660f6d 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t17.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t17.dart @@ -6,16 +6,16 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer -/// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test +/// @description Check that it is no error if an instance variable with a +/// potentially non-nullable type has no initializer expression but initialized +/// in a constructor via an initializing formal or an initializer list entry. +/// Test type ``. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + class A {} class C1 { diff --git a/LanguageFeatures/nnbd/static_errors_A05_t18.dart b/LanguageFeatures/nnbd/static_errors_A05_t18.dart index 1896fd06b3..395c163b3c 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t18.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t18.dart @@ -6,20 +6,22 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer -/// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. Test FutureOr +/// @description Check that it is no error if an instance variable with a +/// potentially non-nullable type has no initializer expression but initialized +/// in a constructor via an initializing formal or an initializer list entry. +/// Test type `FutureOr`. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; typedef void Foo(); + class A {} + void foo() {} dynamic getX() => null; @@ -29,8 +31,17 @@ class C1 { FutureOr f2; FutureOr a1; FutureOr> a2; - C1(FutureOr t, FutureOr f1, FutureOr f2, FutureOr a1, FutureOr> a2) - : this.t1 = t, this.f1 = f1, this.f2 = f2, this.a1 = a1, this.a2 = a2 {} + C1( + FutureOr t, + FutureOr f1, + FutureOr f2, + FutureOr a1, + FutureOr> a2, + ) : this.t1 = t, + this.f1 = f1, + this.f2 = f2, + this.a1 = a1, + this.a2 = a2 {} } class C2 { diff --git a/LanguageFeatures/nnbd/static_errors_A05_t19.dart b/LanguageFeatures/nnbd/static_errors_A05_t19.dart index ac1d9491dc..a67f6bdbad 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t19.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t19.dart @@ -6,17 +6,16 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer -/// expression, and the class has a generative constructor where the variable is -/// not initialized via an initializing formal or an initializer list entry, -/// unless the variable is marked with the late modifier. -/// Test +/// @description Check that it is no error if an instance variable with a +/// potentially non-nullable type has no initializer expression but initialized +/// in a constructor via an initializing formal or an initializer list entry. +/// Test type ``. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + class A {} class C1 { diff --git a/LanguageFeatures/nnbd/static_errors_A05_t21.dart b/LanguageFeatures/nnbd/static_errors_A05_t21.dart index e226c15634..aa6e240b83 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t21.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t21.dart @@ -6,22 +6,34 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test Never +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// type `Never`. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + +abstract class A { + abstract Never n1; + abstract final Never n2; + abstract covariant Never n3; +} + class C { late Never n1; late final Never n2; covariant late Never n3; + + external Never n4; + external final Never n5; } main() { + print(A); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t22.dart b/LanguageFeatures/nnbd/static_errors_A05_t22.dart index 41d4fa1e3c..67be144a0b 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t22.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t22.dart @@ -6,25 +6,34 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test Function +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// type `Function`. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong +abstract class A { + abstract Function x1; + abstract final Function x2; + abstract covariant Function x3; +} + class C { late Function x1; late final Function x2; covariant late Function x3; - C() {} + external Function x4; + external final Function x5; } main() { + print(A); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t23.dart b/LanguageFeatures/nnbd/static_errors_A05_t23.dart index a8b0696e88..9db07409e2 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t23.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t23.dart @@ -6,26 +6,36 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test function type +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// a function type. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + typedef void Foo(); +abstract class A { + abstract Foo x1; + abstract final Foo x2; + abstract covariant Foo x3; +} + class C { late Foo x1; late final Foo x2; covariant late Foo x3; - C() {} + external Foo x4; + external final Foo x5; } main() { + print(A); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t24.dart b/LanguageFeatures/nnbd/static_errors_A05_t24.dart index b2de81cb2e..e03baa43aa 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t24.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t24.dart @@ -6,26 +6,36 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test some class A +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// some class `A`. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + class A {} +abstract class B { + abstract A x1; + abstract final A x2; + abstract covariant A x3; +} + class C { late A x1; late final A x2; covariant late A x3; - C() {} + external A x4; + external final A x5; } main() { + print(B); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t26.dart b/LanguageFeatures/nnbd/static_errors_A05_t26.dart index ec660ce3f7..8e7683c57a 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t26.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t26.dart @@ -6,26 +6,34 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test some type -/// +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// some type ``. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong +abstract class A { + abstract X x1; + abstract final X x2; + abstract covariant X x3; +} + class C { late X x1; late final X x2; covariant late X x3; - C() {} + external X x4; + external final X x5; } main() { + print(A); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t27.dart b/LanguageFeatures/nnbd/static_errors_A05_t27.dart index ab7ebe7095..9e2250efe2 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t27.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t27.dart @@ -6,26 +6,34 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test some type -/// +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// type ``. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong +abstract class A { + abstract X x1; + abstract final X x2; + abstract covariant X x3; +} + class C { late X x1; late final X x2; covariant late X x3; - C() {} + external X x4; + external final X x5; } main() { + print(A); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t28.dart b/LanguageFeatures/nnbd/static_errors_A05_t28.dart index d3c6986413..a78cc58591 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t28.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t28.dart @@ -6,26 +6,36 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test FutureOr +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// type `FutureOr`. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; +abstract class A { + abstract FutureOr x1; + abstract final FutureOr x2; + abstract covariant FutureOr x3; +} + class C { late FutureOr x1; late final FutureOr x2; covariant late FutureOr x3; - C() {} + external FutureOr x4; + external final FutureOr x5; } main() { + print(A); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t29.dart b/LanguageFeatures/nnbd/static_errors_A05_t29.dart index 4e6d20c620..582b4cfca2 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t29.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t29.dart @@ -6,20 +6,28 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test FutureOr where F is -/// a function type +/// the variable is marked with `late`, `abstract`, or `external` modifier. +/// Test `FutureOr` where `F` is a function type /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; + typedef void Foo(); +abstract class A { + abstract FutureOr x1; + abstract final FutureOr x2; + abstract covariant FutureOr x3; +} + class C { late FutureOr x1; late final FutureOr x2; @@ -29,9 +37,14 @@ class C { late final FutureOr x5; covariant late FutureOr x6; - C() {} + external FutureOr x7; + external final FutureOr x8; + + external FutureOr x9; + external final FutureOr x10; } main() { + print(A); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t30.dart b/LanguageFeatures/nnbd/static_errors_A05_t30.dart index 061b94541e..24f575ce54 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t30.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t30.dart @@ -6,28 +6,37 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test FutureOr where A is -/// some class +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// `FutureOr` where `A` is some class. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; + class A {} +abstract class B { + abstract FutureOr x1; + abstract final FutureOr x2; + abstract covariant FutureOr x3; +} class C { late FutureOr x1; late final FutureOr x2; covariant late FutureOr x3; - C() {} + external FutureOr x4; + external final FutureOr x5; } main() { + print(B); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t32.dart b/LanguageFeatures/nnbd/static_errors_A05_t32.dart index 8e1d6788ac..f207f42813 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t32.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t32.dart @@ -6,27 +6,36 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test FutureOr, -/// where +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// type `FutureOr`, where ``. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; +abstract class A { + abstract FutureOr x1; + abstract final FutureOr x2; + abstract covariant FutureOr x3; +} + class C { late FutureOr x1; late final FutureOr x2; covariant late FutureOr x3; - C() {} + external FutureOr x4; + external final FutureOr x5; } main() { + print(A); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t33.dart b/LanguageFeatures/nnbd/static_errors_A05_t33.dart index 5167dcf12d..a2f63f734e 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t33.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t33.dart @@ -6,27 +6,36 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test FutureOr, -/// where +/// the variable is marked with `late`, `abstract`, or `external` modifier. Test +/// `FutureOr`, where ``. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; +abstract class A { + abstract FutureOr x1; + abstract final FutureOr x2; + abstract covariant FutureOr x3; +} + class C { late FutureOr x1; late final FutureOr x2; covariant late FutureOr x3; - C() {} + external FutureOr x4; + external final FutureOr x5; } main() { + print(A); new C(); } diff --git a/LanguageFeatures/nnbd/static_errors_A05_t34.dart b/LanguageFeatures/nnbd/static_errors_A05_t34.dart index 1197a05926..207ca35f02 100644 --- a/LanguageFeatures/nnbd/static_errors_A05_t34.dart +++ b/LanguageFeatures/nnbd/static_errors_A05_t34.dart @@ -6,28 +6,38 @@ /// variable with a potentially non-nullable type and no initializer expression, /// and the class has a generative constructor where the variable is not /// initialized via an initializing formal or an initializer list entry, unless -/// the variable is marked with the late modifier. +/// the variable is marked with a `late`, `abstract`, or `external` modifier. /// -/// @description Check that it is not an error if a class declaration declares an -/// instance variable with a potentially non-nullable type and no initializer +/// @description Check that it is not an error if a class declaration declares +/// an instance variable with a potentially non-nullable type and no initializer /// expression, and the class has a generative constructor where the variable is /// not initialized via an initializing formal or an initializer list entry, but -/// the variable is marked with the 'late' modifier. Test FutureOr> -/// where A is some class +/// the variable is marked with `late`, `abstract`, or `external` modifier. +/// Test `FutureOr>` where `A` is some class. /// @author sgrekhov@unipro.ru // Requirements=nnbd-strong + import "dart:async"; + class A {} +abstract class B { + abstract FutureOr> x1; + abstract final FutureOr> x2; + abstract covariant FutureOr> x3; +} + class C { late FutureOr> x1; late final FutureOr> x2; covariant late FutureOr> x3; - C() {} + external FutureOr> x4; + external final FutureOr> x5; } main() { + print(A); new C(); }