| 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 { |
| self::MyFuture<core::bool> f; |
| self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async => x ?{core::int} 2 : await new self::MyFuture::value<core::int>(3)); |
| self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::Future<core::int> async { |
| return (await x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>; |
| }); |
| self::MyFuture<core::int> t5 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::FutureOr<core::int> => (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>); |
| self::MyFuture<core::int> t6 = f.{self::MyFuture::then}<core::int>((core::bool x) → asy::FutureOr<core::int> { |
| return (x ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>; |
| }); |
| } |
| static method main() → dynamic {} |