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

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

Issue 2924853003: Fix implementation of fold() in analyzer's mock SDK. (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 void main() { 8 void test() {
9 List<int> o; 9 List<int> o;
10 int y = o. /*@typeArgs=int*/ /*@target=List::fold*/ fold( 10 int y = o. /*@typeArgs=int*/ /*@target=Iterable::fold*/ fold(
11 0, 11 0,
12 /*@returnType=int*/ (/*@type=int*/ x, 12 /*@returnType=int*/ (/*@type=int*/ x,
13 /*@type=int*/ y) => 13 /*@type=int*/ y) =>
14 x /*@target=num::+*/ + y); 14 x /*@target=num::+*/ + y);
15 var /*@type=dynamic*/ z = 15 var /*@type=dynamic*/ z =
16 o. /*@typeArgs=dynamic*/ /*@target=List::fold*/ fold( 16 o. /*@typeArgs=dynamic*/ /*@target=Iterable::fold*/ fold(
17 0, 17 0,
18 /*@returnType=dynamic*/ (/*@type=dynamic*/ x, 18 /*@returnType=dynamic*/ (/*@type=dynamic*/ x,
19 /*@type=int*/ y) => /*info:DYNAMIC_INVOKE*/ x + y); 19 /*@type=int*/ y) => /*info:DYNAMIC_INVOKE*/ x + y);
20 y = /*info:DYNAMIC_CAST*/ z; 20 y = /*info:DYNAMIC_CAST*/ z;
21 } 21 }
22 22
23 void functionExpressionInvocation() { 23 void functionExpressionInvocation() {
24 List<int> o; 24 List<int> o;
25 int y = (o. /*@target=List::fold*/ fold) /*@typeArgs=int*/ ( 25 int y = (o. /*@target=Iterable::fold*/ fold) /*@typeArgs=int*/ (
26 0, 26 0,
27 /*@returnType=int*/ (/*@type=int*/ x, 27 /*@returnType=int*/ (/*@type=int*/ x,
28 /*@type=int*/ y) => 28 /*@type=int*/ y) =>
29 x /*@target=num::+*/ + y); 29 x /*@target=num::+*/ + y);
30 var /*@type=dynamic*/ z = 30 var /*@type=dynamic*/ z =
31 (o. /*@target=List::fold*/ fold) /*@typeArgs=dynamic*/ ( 31 (o. /*@target=Iterable::fold*/ fold) /*@typeArgs=dynamic*/ (
32 0, 32 0,
33 /*@returnType=dynamic*/ (/*@type=dynamic*/ x, 33 /*@returnType=dynamic*/ (/*@type=dynamic*/ x,
34 /*@type=int*/ y) => /*info:DYNAMIC_INVOKE*/ x + y); 34 /*@type=int*/ y) => /*info:DYNAMIC_INVOKE*/ x + y);
35 y = /*info:DYNAMIC_CAST*/ z; 35 y = /*info:DYNAMIC_CAST*/ z;
36 } 36 }
37
38 main() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698