| library test; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:120: Error: The method '+' isn't defined for the class 'FutureOr<String>'. |
| // - 'FutureOr' is from 'dart:async'. |
| // 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*/ + |
| // ^ |
| // |
| // pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type 'FutureOr<String> Function(FutureOr<String>, int)'. |
| // - 'FutureOr' is from 'dart:async'. |
| // Try changing the type of the parameter, or casting the argument to 'FutureOr<String> Function(FutureOr<String>, int)'. |
| // /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@returnType=String*/ (String |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| import "dart:async" as asy; |
| |
| import "dart:async"; |
| |
| 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> => invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:120: Error: The method '+' isn't defined for the class 'FutureOr<String>'. |
| - 'FutureOr' is from 'dart:async'. |
| 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 final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type 'FutureOr<String> Function(FutureOr<String>, int)'. |
| - 'FutureOr' is from 'dart:async'. |
| Try changing the type of the parameter, or casting the argument to 'FutureOr<String> Function(FutureOr<String>, int)'. |
| /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@returnType=String*/ (String |
| ^" in ((core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}())) as{TypeError} (asy::FutureOr<core::String>, core::int) → asy::FutureOr<core::String>)); |
| 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 {} |