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 List<String> getListOfString() => const <String>[]; | 8 List<String> getListOfString() => const <String>[]; |
9 | 9 |
10 void foo() { | 10 void foo() { |
11 List myList = getListOfString(); | 11 List myList = getListOfString(); |
12 myList. /*@typeArgs=int*/ /*@target=Iterable::map*/ map( | 12 myList. /*@typeArgs=int*/ /*@target=Iterable::map*/ map( |
13 /*@returnType=int*/ (/*@type=dynamic*/ type) => 42); | 13 /*@returnType=int*/ (/*@type=dynamic*/ type) => 42); |
14 } | 14 } |
15 | 15 |
16 void bar() { | 16 void bar() { |
17 var /*@type=dynamic*/ list; | 17 var /*@type=dynamic*/ list; |
18 try { | 18 try { |
19 list = <String>[]; | 19 list = <String>[]; |
20 } catch (_) { | 20 } catch (_) { |
21 return; | 21 return; |
22 } | 22 } |
23 /*info:DYNAMIC_INVOKE*/ list.map( | 23 /*info:DYNAMIC_INVOKE*/ list.map( |
24 /*@returnType=String*/ (/*@type=dynamic*/ value) => '${value}'); | 24 /*@returnType=String*/ (/*@type=dynamic*/ value) => '${value}'); |
25 } | 25 } |
| 26 |
| 27 main() {} |
OLD | NEW |