blob: 64d369ed59586e8dc0d265f59bed3cb9d558299b [file] [log] [blame]
// Formatted problems:
//
// 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*/ +
// ^
//
// pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: The argument type '(dart.core::String, dart.core::int) → dart.core::String' can't be assigned to the parameter type '(dart.async::FutureOr<dart.core::String>, dart.core::int) → 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) → dart.async::FutureOr<dart.core::String>'.
// /*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@returnType=String*/ (String
// ^
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 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 final<BottomType> #t2 = 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 ((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 {}