-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2979. Update NNBD static errors tests. Part 2
- Loading branch information
Showing
25 changed files
with
300 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
// ^ | ||
|
@@ -34,5 +34,5 @@ class D implements C { | |
} | ||
|
||
main() { | ||
new C.f(); | ||
print(C); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -23,9 +23,6 @@ mixin M on A { | |
// [cfe] unspecified | ||
} | ||
|
||
class C extends A with M { | ||
} | ||
|
||
main() { | ||
new C(); | ||
print(M); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -31,5 +31,5 @@ class D implements C { | |
} | ||
|
||
main() { | ||
new C.f(); | ||
print(C); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -23,9 +23,6 @@ mixin M on A { | |
// [cfe] unspecified | ||
} | ||
|
||
class C extends A with M { | ||
} | ||
|
||
main() { | ||
new C(); | ||
print(M); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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() {} | ||
|
@@ -33,5 +33,5 @@ class D implements C { | |
} | ||
|
||
main() { | ||
new C.f(); | ||
print(C); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 {} | ||
|
@@ -25,9 +25,6 @@ mixin M on A { | |
// [cfe] unspecified | ||
} | ||
|
||
class C extends A with M { | ||
} | ||
|
||
main() { | ||
new C(); | ||
print(M); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -31,5 +31,5 @@ class D implements C { | |
} | ||
|
||
main() { | ||
new C.f(); | ||
print(C); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 {} | ||
|
||
|
@@ -25,9 +24,6 @@ mixin M on A { | |
// [cfe] unspecified | ||
} | ||
|
||
class C extends A with M { | ||
} | ||
|
||
main() { | ||
new C(); | ||
print(M); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
// ^ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
// ^ | ||
|
@@ -30,5 +30,5 @@ class D<X extends Object?> implements C<X> { | |
} | ||
|
||
main() { | ||
new C<String>.f("Lily was here"); | ||
print(C)l | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -28,5 +28,5 @@ class C extends X with M<String> { | |
} | ||
|
||
main() { | ||
new C(); | ||
print(C); | ||
} |
Oops, something went wrong.