Skip to content

Commit

Permalink
#2979. Update NNBD static errors tests. Part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrekhov committed Nov 18, 2024
1 parent 118e7db commit 4d33d3b
Show file tree
Hide file tree
Showing 25 changed files with 300 additions and 174 deletions.
12 changes: 6 additions & 6 deletions LanguageFeatures/nnbd/static_errors_A06_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
/// @issue 40677
/// @issue 40940

class C {
Never n;
// ^
Expand All @@ -34,5 +34,5 @@ class D implements C {
}

main() {
new C.f();
print(C);
}
15 changes: 6 additions & 9 deletions LanguageFeatures/nnbd/static_errors_A06_t02.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
/// @issue 40940

class A {}

mixin M on A {
Expand All @@ -23,9 +23,6 @@ mixin M on A {
// [cfe] unspecified
}

class C extends A with M {
}

main() {
new C();
print(M);
}
12 changes: 6 additions & 6 deletions LanguageFeatures/nnbd/static_errors_A06_t03.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
/// @issue 40677
/// @issue 40940

void foo() {}

class C {
Expand All @@ -31,5 +31,5 @@ class D implements C {
}

main() {
new C.f();
print(C);
}
15 changes: 6 additions & 9 deletions LanguageFeatures/nnbd/static_errors_A06_t04.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
/// @issue 40940

class A {}

mixin M on A {
Expand All @@ -23,9 +23,6 @@ mixin M on A {
// [cfe] unspecified
}

class C extends A with M {
}

main() {
new C();
print(M);
}
12 changes: 6 additions & 6 deletions LanguageFeatures/nnbd/static_errors_A06_t05.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
/// @issue 40677
/// @issue 40940

typedef void Foo();

void foo() {}
Expand All @@ -33,5 +33,5 @@ class D implements C {
}

main() {
new C.f();
print(C);
}
15 changes: 6 additions & 9 deletions LanguageFeatures/nnbd/static_errors_A06_t06.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
/// @issue 40940

typedef void Foo();

class A {}
Expand All @@ -25,9 +25,6 @@ mixin M on A {
// [cfe] unspecified
}

class C extends A with M {
}

main() {
new C();
print(M);
}
12 changes: 6 additions & 6 deletions LanguageFeatures/nnbd/static_errors_A06_t07.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
/// @issue 40677
/// @issue 40940

class X {}

class C {
Expand All @@ -31,5 +31,5 @@ class D implements C {
}

main() {
new C.f();
print(C);
}
16 changes: 6 additions & 10 deletions LanguageFeatures/nnbd/static_errors_A06_t08.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
/// @issue 40940


class A {}
class X {}

Expand All @@ -25,9 +24,6 @@ mixin M on A {
// [cfe] unspecified
}

class C extends A with M {
}

main() {
new C();
print(M);
}
12 changes: 6 additions & 6 deletions LanguageFeatures/nnbd/static_errors_A06_t11.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// <X extends Object>
/// non-nullable type and no initializing expression. Test some type
/// `<X extends Object>`.
/// @author [email protected]
/// @issue 40677
/// @issue 40940

class C<X extends Object> {
X x;
// ^
Expand Down
17 changes: 7 additions & 10 deletions LanguageFeatures/nnbd/static_errors_A06_t12.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// <T extends Object>
/// non-nullable type and no initializing expression. Test some type
/// `<T extends Object>`.
/// @author [email protected]
/// @issue 40940

class X {}

mixin M<T extends Object> on X {
Expand All @@ -24,9 +24,6 @@ mixin M<T extends Object> on X {
// [cfe] unspecified
}

class C extends X with M<String> {
}

main() {
new C();
print(M);
}
14 changes: 7 additions & 7 deletions LanguageFeatures/nnbd/static_errors_A06_t13.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// <X extends Object?>
/// non-nullable type and no initializing expression. Test some type
/// `<X extends Object?>`.
/// @author [email protected]
/// @issue 40677
/// @issue 40940

class C<X extends Object?> {
X x;
// ^
Expand All @@ -30,5 +30,5 @@ class D<X extends Object?> implements C<X> {
}

main() {
new C<String>.f("Lily was here");
print(C)l
}
14 changes: 7 additions & 7 deletions LanguageFeatures/nnbd/static_errors_A06_t14.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// <T extends Object?>
/// non-nullable type and no initializing expression. Test some type
/// `<T extends Object?>`.
/// @author [email protected]
/// @issue 40940

class X {}

mixin M<T extends Object?> on X {
Expand All @@ -28,5 +28,5 @@ class C extends X with M<String> {
}

main() {
new C();
print(C);
}
Loading

0 comments on commit 4d33d3b

Please sign in to comment.