blob: 93b15b08192ba3518628e65a705e5bed6ed94197 [file] [log] [blame]
library test;
import self as self;
import "dart:async" as asy;
import "dart:math" as math;
import "dart:core" as core;
static method test() dynamic {
dynamic f = () asy::Future<dynamic> /* originally async */ {
final asy::Completer<dynamic> :completer = asy::Completer::sync<dynamic>();
asy::FutureOr<dynamic> :return_value;
dynamic :async_stack_trace;
dynamic :async_op_then;
dynamic :async_op_error;
dynamic :await_jump_var = 0;
dynamic :await_ctx_var;
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) dynamic yielding
try {
#L1:
{
if(math::Random::•().nextBool()) {
:return_value = 1;
break #L1;
}
else {
:return_value = 2.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};
};
asy::Future<core::num> g = f.call();
asy::Future<core::int> h = f.call();
}
static method main() dynamic {}