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

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

Issue 2846103002: Generated front_end/testcases/inference test files from Analyzer tests. (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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 /*@testedFeatures=inference*/
6 library test;
7
8 import 'dart:async';
9
10 Future<int> make(int x) =>
11 (/*@typeArgs=int*/ new Future(/*@returnType=int*/ () => x));
12
13 main() {
14 Iterable<Future<int>> list = <int>[1, 2, 3].map(make);
15 Future<List<int>> results = Future.wait(/*@promotedType=none*/ list);
16 Future<String> results2 = /*@promotedType=none*/ results.then(
17 /*@returnType=FutureOr<String>*/ (List<int> list) => list.fold(
18 '',
19 /*@returnType=FutureOr<String>*/ (/*@type=FutureOr<String>*/ x,
20 /*@type=int*/ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
21 y.toString()));
22
23 Future<String> results3 = /*@promotedType=none*/ results.then(
24 /*@returnType=FutureOr<String>*/ (List<int> list) => list.fold(
25 '',
26 /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@r eturnType=String*/ (String
27 x,
28 /*@type=int*/ y) =>
29 x + y.toString()));
30
31 Future<String> results4 = /*@promotedType=none*/ results.then(
32 /*@returnType=String*/ (List<int> list) => list.fold<String>(
33 '',
34 /*@returnType=String*/ (/*@type=String*/ x, /*@type=int*/ y) =>
35 x + y.toString()));
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698