| library test; |
| import self as self; |
| import "dart:core" as core; |
| import "dart:async" as asy; |
| |
| static method make(core::int x) → asy::Future<core::int> |
| return asy::Future::•<core::int>(() → core::int => x); |
| static method test() → dynamic { |
| core::Iterable<asy::Future<core::int>> list = <core::int>[1, 2, 3].{core::Iterable::map}<asy::Future<core::int>>(self::make); |
| asy::Future<core::List<core::int>> results = asy::Future::wait<core::int>(list); |
| asy::Future<core::String> results2 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", (asy::FutureOr<core::String> x, core::int y) → asy::FutureOr<core::String> => (let final dynamic #t1 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:120: Error: The method '+' isn't defined for the class 'dart.async::FutureOr<dart.core::String>'. |
| Try correcting the name to the name of an existing method, or defining a method named '+'. |
| /*@type=int*/ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ + |
| ^") as{TypeError} asy::FutureOr<core::String>)); |
| asy::Future<core::String> results3 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", let dynamic _ = null in let final dynamic #t2 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: The argument type '(dart.core::String, dart.core::int) \u8594 dart.core::String' can't be assigned to the parameter type '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'. |
| Try changing the type of the parameter, or casting the argument to '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'. |
| /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@returnType=String*/ (String |
| ^" in let final dynamic #t3 = (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}()) in null)); |
| asy::Future<core::String> results4 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → core::String => list.{core::Iterable::fold}<core::String>("", (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}()))); |
| } |
| static method main() → dynamic {} |