|
@@ -9,7 +9,8 @@ let fun_to_coro ctx e tf =
|
|
let v_error = alloc_var VGenerated "_hx_error" t_dynamic p in
|
|
let v_error = alloc_var VGenerated "_hx_error" t_dynamic p in
|
|
let cb_root = make_block (Some(e.etype,p)) in
|
|
let cb_root = make_block (Some(e.etype,p)) in
|
|
ignore(CoroFromTexpr.expr_to_coro ctx (v_result,v_error) cb_root tf.tf_expr);
|
|
ignore(CoroFromTexpr.expr_to_coro ctx (v_result,v_error) cb_root tf.tf_expr);
|
|
- let vcontinuation = alloc_var VGenerated "_hx_continuation" (tfun [tf.tf_type; t_dynamic] ctx.com.basic.tvoid) p in
|
|
|
|
|
|
+ let ret_type = if ExtType.is_void (follow tf.tf_type) then t_dynamic else tf.tf_type in
|
|
|
|
+ let vcontinuation = alloc_var VGenerated "_hx_continuation" (tfun [ret_type; t_dynamic] ctx.com.basic.tvoid) p in
|
|
let tf_expr = CoroToTexpr.block_to_texpr_coroutine ctx cb_root vcontinuation v_result v_error e.epos in
|
|
let tf_expr = CoroToTexpr.block_to_texpr_coroutine ctx cb_root vcontinuation v_result v_error e.epos in
|
|
let tf_args = tf.tf_args @ [(vcontinuation,None)] in
|
|
let tf_args = tf.tf_args @ [(vcontinuation,None)] in
|
|
let tf_type = tfun [t_dynamic; t_dynamic] ctx.com.basic.tvoid in
|
|
let tf_type = tfun [t_dynamic; t_dynamic] ctx.com.basic.tvoid in
|