OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; | |
6 | |
7 // Map takes 2 type arguments. | 5 // Map takes 2 type arguments. |
8 Map | 6 Map |
9 <String> /// 00: static type warning | 7 <String> /// 00: static type warning |
10 foo; | 8 foo; |
11 Map | 9 Map |
12 <String> /// 02: static type warning | 10 <String> /// 02: static type warning |
13 baz; | 11 baz; |
14 | 12 |
15 main() { | 13 main() { |
16 foo = null; | 14 foo = null; |
(...skipping 17 matching lines...) Expand all Loading... |
34 bool got_type_error = false; | 32 bool got_type_error = false; |
35 try { | 33 try { |
36 baz = new Map(); | 34 baz = new Map(); |
37 } on TypeError catch (error) { | 35 } on TypeError catch (error) { |
38 print(error); | 36 print(error); |
39 got_type_error = true; | 37 got_type_error = true; |
40 } | 38 } |
41 // Type error in checked mode only. | 39 // Type error in checked mode only. |
42 Expect.isTrue(got_type_error == isCheckedMode()); | 40 Expect.isTrue(got_type_error == isCheckedMode()); |
43 } | 41 } |
OLD | NEW |