| 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;
|
|
|