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

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

Issue 2865403007: Get rid of promotedType=none annotations (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*/ () => /*@promotedType=none*/ x)); 11 /*@returnType=int*/ () => x));
12 12
13 main() { 13 main() {
14 Iterable<Future<int>> list = 14 Iterable<Future<int>> list =
15 <int>[1, 2, 3]. /*@typeArgs=Future<int>*/ /*@target=List::map*/ map(make); 15 <int>[1, 2, 3]. /*@typeArgs=Future<int>*/ /*@target=List::map*/ map(make);
16 Future<List<int>> results = 16 Future<List<int>> results =
17 Future. /*@typeArgs=int*/ /*@target=Future::wait*/ wait( 17 Future. /*@typeArgs=int*/ /*@target=Future::wait*/ wait(list);
18 /*@promotedType=none*/ list); 18 Future<String> results2 =
19 Future<String> results2 = /*@promotedType=none*/ results 19 results. /*@typeArgs=String*/ /*@target=Future::then*/ then(
20 . /*@typeArgs=String*/ /*@target=Future::then*/ then( 20 /*@returnType=FutureOr<String>*/ (List<int> list) =>
21 /*@returnType=FutureOr<String>*/ (List<int> list) => /*@promotedType=n one*/ list 21 list. /*@typeArgs=FutureOr<String>*/ /*@target=List::fold*/ fold(
22 . /*@typeArgs=FutureOr<String>*/ /*@target=List::fold*/ fold(
23 '', 22 '',
24 /*@returnType=FutureOr<String>*/ (/*@type=FutureOr<String>*/ x , 23 /*@returnType=FutureOr<String>*/ (/*@type=FutureOr<String>*/ x ,
25 /*@type=int*/ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_I NVOKE*/ /*@promotedType=none*/ x /*error:UNDEFINED_OPERATOR*/ + 24 /*@type=int*/ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_I NVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
26 /*@promotedType=none*/ y 25 y. /*@target=Object::toString*/ toString()));
27 . /*@target=Object::toString*/ toString()));
28 26
29 Future<String> results3 = /*@promotedType=none*/ results 27 Future<String> results3 =
30 . /*@typeArgs=String*/ /*@target=Future::then*/ then( 28 results. /*@typeArgs=String*/ /*@target=Future::then*/ then(
31 /*@returnType=FutureOr<String>*/ (List<int> list) => /*@promotedType=n one*/ list 29 /*@returnType=FutureOr<String>*/ (List<int> list) =>
32 . /*@typeArgs=FutureOr<String>*/ /*@target=List::fold*/ fold( 30 list. /*@typeArgs=FutureOr<String>*/ /*@target=List::fold*/ fold(
33 '', 31 '',
34 /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABL E*/ /*@returnType=String*/ (String 32 /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABL E*/ /*@returnType=String*/ (String
35 x, 33 x,
36 /*@type=int*/ y) => 34 /*@type=int*/ y) =>
37 /*@promotedType=none*/ x /*@target=String::+*/ + /*@promot edType=none*/ y 35 x /*@target=String::+*/ +
38 . /*@target=Object::toString*/ toString())); 36 y. /*@target=Object::toString*/ toString()));
39 37
40 Future<String> results4 = /*@promotedType=none*/ results 38 Future<String> results4 =
41 . /*@typeArgs=String*/ /*@target=Future::then*/ then( 39 results. /*@typeArgs=String*/ /*@target=Future::then*/ then(
42 /*@returnType=String*/ (List<int> 40 /*@returnType=String*/ (List<int> list) =>
43 list) => /*@promotedType=none*/ list. /*@target=List::fold*/ fold< 41 list. /*@target=List::fold*/ fold<String>(
44 String>( 42 '',
45 '', 43 /*@returnType=String*/ (/*@type=String*/ x,
46 /*@returnType=String*/ (/*@type=String*/ x, 44 /*@type=int*/ y) =>
47 /*@type=int*/ y) => 45 x /*@target=String::+*/ +
48 /*@promotedType=none*/ x /*@target=String::+*/ + /*@promotedTy pe=none*/ y 46 y. /*@target=Object::toString*/ toString()));
49 . /*@target=Object::toString*/ toString()));
50 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698