Skip to content

Commit f6fb6e1

Browse files
committed
fix some types
1 parent a1f1ee1 commit f6fb6e1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/context/typecore.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ let s_field_call_candidate fcc =
615615
]
616616

617617

618+
(* TODO: this is wrong *)
618619
let coroutine_type ctx args ret =
619620
let args = args @ [("_hx_continuation",false,(tfun [ret; t_dynamic] ctx.com.basic.tvoid))] in
620621
let ret = ctx.com.basic.tvoid in

src/optimization/analyzerTexprTransformer.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ and block_to_texpr_coroutine ctx bb vcontinuation vresult verror p =
776776
let eexcstate = make_local vexcstate p in
777777
let set_excstate id = mk_assign eexcstate (mk_int id) in
778778

779-
let tstatemachine = tfun [t_dynamic] com.basic.tvoid in
779+
let tstatemachine = tfun [t_dynamic; t_dynamic] com.basic.tvoid in
780780
let vstatemachine = alloc_var VGenerated "_hx_stateMachine" tstatemachine p in
781781
declare_var ctx.graph vstatemachine bb;
782782
let estatemachine = make_local vstatemachine p in
@@ -1132,11 +1132,12 @@ and func ctx i =
11321132
let e,tf_args,tf_type =
11331133
match tfi.tf_coroutine with
11341134
| Some (vresult,verror) ->
1135-
let vcontinuation = alloc_var VGenerated "_hx_continuation" (tfun [t_dynamic] ctx.com.basic.tvoid) p in
1135+
let vcontinuation = alloc_var VGenerated "_hx_continuation" (tfun [tf.tf_type; t_dynamic] ctx.com.basic.tvoid) p in
11361136
declare_var ctx.graph vcontinuation bb;
11371137
let e = block_to_texpr_coroutine ctx bb vcontinuation vresult verror p in
11381138
let tf_args = tf.tf_args @ [(vcontinuation,None)] in
1139-
e, tf_args, tf.tf_type
1139+
let sm_type = tfun [t_dynamic; t_dynamic] ctx.com.basic.tvoid in
1140+
e, tf_args, sm_type
11401141
| None ->
11411142
block_to_texpr ctx bb, tf.tf_args, tf.tf_type
11421143
in

0 commit comments

Comments
 (0)