Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Unified Diff: test/checker/checker_test.dart

Issue 1396993002: housecleaning: remove nonnullableTypes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/checker/checker_test.dart
diff --git a/test/checker/checker_test.dart b/test/checker/checker_test.dart
index 62718cf5476e17b483e660383ca225071709b6d4..c9ba84ca531bb203d829388c9dc45f4a9ea58d9f 100644
--- a/test/checker/checker_test.dart
+++ b/test/checker/checker_test.dart
@@ -207,103 +207,6 @@ void main() {
'''
});
- testChecker('Primitives', {
- '/main.dart': '''
- int /*severe:InvalidVariableDeclaration*/a;
- double /*severe:InvalidVariableDeclaration*/b;
- num c;
-
- class A {
- int a;
- double b;
- num c;
-
- static int /*severe:InvalidVariableDeclaration*/x;
- static double /*severe:InvalidVariableDeclaration*/y;
- static num z;
- }
-
- void foo(int w, [int x = /*severe:StaticTypeError*/null, int /*severe:InvalidVariableDeclaration*/y, int z = 0]) {
- }
-
- void bar(int w, {int x = /*severe:StaticTypeError*/null, int /*severe:InvalidVariableDeclaration*/y, int z: 0}) {
- }
-
- void main() {
- int /*severe:InvalidVariableDeclaration*/x;
- double /*severe:InvalidVariableDeclaration*/y;
- num z;
- bool b;
-
- // int is non-nullable
- x = /*severe:StaticTypeError*/null;
- x = 42;
- x = /*info:DownCastImplicit*/z;
-
- // double is non-nullable
- y = /*severe:StaticTypeError*/null;
- y = /*severe:StaticTypeError*/42;
- y = 42.0;
- y = /*info:DownCastImplicit*/z;
-
- // num is nullable
- z = null;
- z = x;
- z = y;
-
- // bool is nullable
- b = null;
- b = true;
- }
- '''
- }, nonnullableTypes: <String>[
- 'int',
- 'double'
- ]);
-
- testChecker('Primitives and generics', {
- '/main.dart': '''
- class A<T> {
- // TODO(vsm): This needs a static info indicating a runtime
- // check at construction.
- T x;
-
- // TODO(vsm): Should this be a different type of DownCast?
- T foo() => /*info:DownCastImplicit*/null;
-
- void bar() {
- int /*severe:InvalidVariableDeclaration*/x;
- num y;
- // TODO(vsm): This should be a runtime check:
- // Transformed to: T z = cast(null, T)
- T /*severe:InvalidVariableDeclaration*/z;
- }
-
- void baz(T x, [T /*severe:InvalidVariableDeclaration*/y, T z = /*info:DownCastImplicit*/null]) {
- }
- }
-
- class B<T extends List> {
- T x;
-
- // T cannot be primitive.
- T foo() => null;
- }
-
- class C<T extends num> {
- // TODO(vsm): This needs a static info indicating a runtime
- // check at construction.
- T x;
-
- // TODO(vsm): Should this be a different type of DownCast?
- T foo() => /*info:DownCastImplicit*/null;
- }
- '''
- }, nonnullableTypes: <String>[
- 'int',
- 'double'
- ]);
-
testChecker('Constructors', {
'/main.dart': '''
const num z = 25;

Powered by Google App Engine
This is Rietveld 408576698