OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /*@testedFeatures=inference*/ | 5 /*@testedFeatures=inference*/ |
6 library test; | 6 library test; |
7 | 7 |
8 class Foo { | 8 class Foo { |
9 int bar = 42; | 9 int bar = 42; |
10 } | 10 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 for (var /*@type=dynamic*/ x in /*error:FOR_IN_OF_INVALID_TYPE*/ map) { | 60 for (var /*@type=dynamic*/ x in /*error:FOR_IN_OF_INVALID_TYPE*/ map) { |
61 String y = /*info:DYNAMIC_CAST*/ x; | 61 String y = /*info:DYNAMIC_CAST*/ x; |
62 } | 62 } |
63 | 63 |
64 // We're not properly inferring that map.keys is an Iterable<String> | 64 // We're not properly inferring that map.keys is an Iterable<String> |
65 // and that x is a String. | 65 // and that x is a String. |
66 for (var /*@type=String*/ x in map. /*@target=Map::keys*/ keys) { | 66 for (var /*@type=String*/ x in map. /*@target=Map::keys*/ keys) { |
67 String y = x; | 67 String y = x; |
68 } | 68 } |
69 } | 69 } |
| 70 |
| 71 main() {} |
OLD | NEW |