blob: 5db216e00b0665acfb3ac860a51dd4837f9b798f [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 {
self::MyFuture<core::bool> f;
self::MyFuture<core::int> t1 = f.{self::MyFuture::then}<core::int>((core::bool x) asy::Future<core::int> /* originally async */ {
final asy::Completer<core::int> :completer = asy::Completer::sync<core::int>();
asy::FutureOr<core::int> :return_value;
dynamic :async_stack_trace;
dynamic :async_op_then;
dynamic :async_op_error;
dynamic :await_jump_var = 0;
dynamic :await_ctx_var;
dynamic :saved_try_context_var0;
dynamic :async_temporary_0;
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) dynamic yielding
try {
#L1:
{
if(x) {
:async_temporary_0 = 2;
}
else {
[yield] let dynamic #t1 = asy::_awaitHelper(new self::MyFuture::value<core::int>(3), :async_op_then, :async_op_error, :async_op) in null;
:async_temporary_0 = :result;
}
:return_value = :async_temporary_0;
break #L1;
}
:completer.{asy::Completer::complete}(:return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
:completer.{asy::Completer::completeError}(:exception, :stack_trace);
}
:async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
:async_op_then = asy::_asyncThenWrapperHelper(:async_op);
:async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
asy::Future::microtask<dynamic>(:async_op);
return :completer.{asy::Completer::future};
});
self::MyFuture<core::int> t2 = f.{self::MyFuture::then}<core::int>((core::bool x) asy::Future<core::int> /* originally async */ {
final asy::Completer<core::int> :completer = asy::Completer::sync<core::int>();
asy::FutureOr<core::int> :return_value;
dynamic :async_stack_trace;
dynamic :async_op_then;
dynamic :async_op_error;
dynamic :await_jump_var = 0;
dynamic :await_ctx_var;
dynamic :saved_try_context_var0;
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) dynamic yielding
try {
#L2:
{
[yield] let dynamic #t2 = asy::_awaitHelper(x, :async_op_then, :async_op_error, :async_op) in null;
:return_value = (:result ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
:completer.{asy::Completer::complete}(:return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
:completer.{asy::Completer::completeError}(:exception, :stack_trace);
}
:async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
:async_op_then = asy::_asyncThenWrapperHelper(:async_op);
:async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
asy::Future::microtask<dynamic>(:async_op);
return :completer.{asy::Completer::future};
});
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 {}