Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: pkg/front_end/testcases/inference/lambda_does_not_have_propagated_type_hint.dart

Issue 2949093002: Properly type infer for-in loops when the iterator type is a type parameter. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698