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 7b9b933973941f16ec1a328330c89e10378b925a..9e222ce95bdadbb9e52b4efde8079fc8e39f3f72 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 |
@@ -48,10 +48,19 @@ main() { |
checkFile('''int x = null;'''); |
} |
- @failingTest |
void test_nonnullableTypes() { |
// If `int`s are non-nullable, then this code should throw an error. |
+ addFile('''int x;'''); |
Jennifer Messerly
2016/08/03 18:06:56
if it's a 1-liner, you can use single quotes. The
stanm
2016/08/03 18:46:20
I was too lazy to think and just copied code over
|
addFile('''int x = /*error:INVALID_ASSIGNMENT*/null;'''); |
+ addFile('''int x = 0;'''); |
+ addFile(''' |
+int x = 0; |
+ |
+main() { |
+ x = 1; |
+ x = /*error:INVALID_ASSIGNMENT*/null; |
+} |
+'''); |
check(nonnullableTypes: <String>['dart:core,int']); |
} |
} |