| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Tests for type inference. | 5 /// Tests for type inference. |
| 6 library dev_compiler.test.inferred_type_test; | 6 library dev_compiler.test.inferred_type_test; |
| 7 | 7 |
| 8 import 'package:unittest/compact_vm_config.dart'; | |
| 9 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 10 | 9 |
| 11 import 'package:dev_compiler/src/testing.dart'; | 10 import 'package:dev_compiler/src/testing.dart'; |
| 12 | 11 |
| 13 main() { | 12 import '../test_util.dart'; |
| 14 useCompactVMConfiguration(); | 13 |
| 14 void main() { |
| 15 configureTest(); |
| 16 |
| 15 test('infer type on var', () { | 17 test('infer type on var', () { |
| 16 // Error also expected when declared type is `int`. | 18 // Error also expected when declared type is `int`. |
| 17 testChecker({ | 19 testChecker({ |
| 18 '/main.dart': ''' | 20 '/main.dart': ''' |
| 19 test1() { | 21 test1() { |
| 20 int x = 3; | 22 int x = 3; |
| 21 x = /*severe:StaticTypeError*/"hi"; | 23 x = /*severe:StaticTypeError*/"hi"; |
| 22 } | 24 } |
| 23 ''' | 25 ''' |
| 24 }); | 26 }); |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 I3 get a => null; | 927 I3 get a => null; |
| 926 } | 928 } |
| 927 | 929 |
| 928 class C2 extends A implements B { | 930 class C2 extends A implements B { |
| 929 /*severe:InvalidMethodOverride*/get a => null; | 931 /*severe:InvalidMethodOverride*/get a => null; |
| 930 } | 932 } |
| 931 ''' | 933 ''' |
| 932 }, inferFromOverrides: true); | 934 }, inferFromOverrides: true); |
| 933 }); | 935 }); |
| 934 } | 936 } |
| OLD | NEW |