blob: 8cdf4371f578111042444f98fd8f979abb7a2108 [file] [log] [blame]
library test;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() void
: super core::Object::•() {}
constructor value([dynamic x = null]) void
: super core::Object::•() {}
abstract method noSuchMethod(core::Invocation invocation) dynamic;
method then<S extends core::Object>((self::MyFuture::T) asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) self::MyFuture<self::MyFuture::then::S>
return null;
}
static field self::MyFuture<dynamic> f;
static field asy::Future<core::int> t1 = self::f.{self::MyFuture::then}<core::int>((dynamic _) asy::Future<core::int> => asy::Future::value<core::int>(let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_union_downwards.dart:21:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::FutureOr<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<dart.core::int>'.
new /*@typeArgs=int*/ Future.value('hi'));
^"));
static field asy::Future<core::List<core::int>> t2 = self::f.{self::MyFuture::then}<core::List<core::int>>((dynamic _) → core::List<core::int> => <core::int>[3]);
static method g2() → asy::Future<core::List<core::int>> async {
return <core::int>[3];
}
static method g3() → asy::Future<core::List<core::int>> async {
return asy::Future::value<core::List<core::int>>(<core::int>[3]);
}
static method main() → dynamic {}