Chromium Code Reviews| Index: pkg/analyzer/test/src/task/strong/non_null_checker_test.dart |
| diff --git a/pkg/analyzer/test/src/task/strong/non_null_checker_test.dart b/pkg/analyzer/test/src/task/strong/non_null_checker_test.dart |
| index 1b2a7a6de77f6e864c07d9e3ce6365c4a12c8290..1ba4aaf59baac9fe0ceecc7302677165f71d70ca 100644 |
| --- a/pkg/analyzer/test/src/task/strong/non_null_checker_test.dart |
| +++ b/pkg/analyzer/test/src/task/strong/non_null_checker_test.dart |
| @@ -42,4 +42,17 @@ main() { |
| } |
| '''); |
| } |
| + |
| + void test_nullableTypes() { |
| + // By default x can be set to null. |
| + addFile('''int x = null;'''); |
| + check(); |
| + } |
| + |
| + @failingTest |
| + void test_nonnullableTypes() { |
| + // If `int`s are non-nullable, then this code should throw an error. |
| + addFile('''int x = /*error:INVALID_ASSIGNMENT*/null;'''); |
| + check(nonnullableTypes: <String>['int']); |
|
Jennifer Messerly
2016/08/02 16:18:51
to build on Brian's comment, consider qualifying i
Brian Wilkerson
2016/08/02 16:25:18
Unless this is intended to be a general purpose me
stanm
2016/08/02 16:56:05
I agree it's a bit of an overkill, but it actually
|
| + } |
| } |