blob: d31aa187cb3eb1091a5b5ed8aed0f003507b355d [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(self::MyFuture::T x) 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 method test() void {
asy::Future<core::double> f = self::foo().{asy::Future::then}<core::double>((dynamic _) core::double => 2.3);
asy::Future<core::int> f2 = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards_3.dart:21:49: Error: A value of type 'dart.async::Future<dart.core::double>' can't be assigned to a variable of type 'dart.async::Future<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Future<dart.core::int>'.
Future<int> f2 = /*error:INVALID_ASSIGNMENT*/ f;
^" in let final dynamic #t2 = f in null;
asy::Future<core::num> f3 = self::foo().{asy::Future::then}<core::double>((dynamic _) → core::double => 2.3) as asy::Future<core::double>;
}
static method foo() → asy::Future<dynamic>
return asy::Future::value<core::int>(1);
static method main() → dynamic {}