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

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

Issue 2884443002: Remove List.map from analyzer's mock SDK (Closed)
Patch Set: Created 3 years, 7 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 import 'dart:async'; 8 import 'dart:async';
9 9
10 Future<int> make(int x) => (new /*@typeArgs=int*/ Future( 10 Future<int> make(int x) => (new /*@typeArgs=int*/ Future(
11 /*@returnType=int*/ () => x)); 11 /*@returnType=int*/ () => x));
12 12
13 main() { 13 main() {
14 Iterable<Future<int>> list = 14 Iterable<Future<int>> list = <int>[1, 2, 3]
15 <int>[1, 2, 3]. /*@typeArgs=Future<int>*/ /*@target=List::map*/ map(make); 15 . /*@typeArgs=Future<int>*/ /*@target=Iterable::map*/ map(make);
16 Future<List<int>> results = 16 Future<List<int>> results =
17 Future. /*@typeArgs=int*/ /*@target=Future::wait*/ wait(list); 17 Future. /*@typeArgs=int*/ /*@target=Future::wait*/ wait(list);
18 Future<String> results2 = 18 Future<String> results2 =
19 results. /*@typeArgs=String*/ /*@target=Future::then*/ then( 19 results. /*@typeArgs=String*/ /*@target=Future::then*/ then(
20 /*@returnType=FutureOr<String>*/ (List<int> list) => 20 /*@returnType=FutureOr<String>*/ (List<int> list) =>
21 list. /*@typeArgs=FutureOr<String>*/ /*@target=List::fold*/ fold( 21 list. /*@typeArgs=FutureOr<String>*/ /*@target=List::fold*/ fold(
22 '', 22 '',
23 /*@returnType=FutureOr<String>*/ (/*@type=FutureOr<String>*/ x , 23 /*@returnType=FutureOr<String>*/ (/*@type=FutureOr<String>*/ x ,
24 /*@type=int*/ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_I NVOKE*/ x /*error:UNDEFINED_OPERATOR*/ + 24 /*@type=int*/ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_I NVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
25 y. /*@target=Object::toString*/ toString())); 25 y. /*@target=Object::toString*/ toString()));
(...skipping 12 matching lines...) Expand all
38 Future<String> results4 = 38 Future<String> results4 =
39 results. /*@typeArgs=String*/ /*@target=Future::then*/ then( 39 results. /*@typeArgs=String*/ /*@target=Future::then*/ then(
40 /*@returnType=String*/ (List<int> list) => 40 /*@returnType=String*/ (List<int> list) =>
41 list. /*@target=List::fold*/ fold<String>( 41 list. /*@target=List::fold*/ fold<String>(
42 '', 42 '',
43 /*@returnType=String*/ (/*@type=String*/ x, 43 /*@returnType=String*/ (/*@type=String*/ x,
44 /*@type=int*/ y) => 44 /*@type=int*/ y) =>
45 x /*@target=String::+*/ + 45 x /*@target=String::+*/ +
46 y. /*@target=Object::toString*/ toString())); 46 y. /*@target=Object::toString*/ toString()));
47 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698