blob: 65237826810205678c40f774a4d753d6005a0bc8 [file] [log] [blame]
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:123: Error: The operator '+' isn't defined for the class 'FutureOr<String>'.
// Try correcting the operator to an existing operator, or defining a '+' operator.
// /*@ 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:111: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type '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*>*>(#C1);
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) FutureOr<core::String*>* => list.{core::Iterable::fold}<FutureOr<core::String*>*>("", (FutureOr<core::String*>* x, core::int* y) FutureOr<core::String*>* => invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:23:123: Error: The operator '+' isn't defined for the class 'FutureOr<String>'.
Try correcting the operator to an existing operator, or defining a '+' operator.
/*@ type=int* */ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
^" as{TypeError,ForDynamic} FutureOr<core::String*>*));
asy::Future<core::String*>* results3 = results.{asy::Future::then}<core::String*>((core::List<core::int*>* list) FutureOr<core::String*>* => list.{core::Iterable::fold}<FutureOr<core::String*>*>("", let final Never* #t1 = invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:111: Error: The argument type 'String Function(String, int)' can't be assigned to the parameter type '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} (FutureOr<core::String*>*, core::int*) →* 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 {}
constants {
#C1 = tearoff self::make
}