Skip to content

Commit a1f1ee1

Browse files
committed
[everywhere] add coro argument to TFun
1 parent e51940f commit a1f1ee1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+465
-442
lines changed

src/codegen/codegen.ml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ let update_cache_dependencies t =
9090
| TAbstract(a,tl) ->
9191
add_dependency m a.a_module;
9292
List.iter (check_t m) tl;
93-
| TFun(targs,tret) ->
93+
| TFun(targs,tret,_) ->
9494
List.iter (fun (_,_,t) -> check_t m t) targs;
9595
check_t m tret;
9696
| TAnon an ->
@@ -157,9 +157,13 @@ let rec find_field com c f =
157157

158158
let fix_override com c f fd =
159159
let f2 = (try Some (find_field com c f) with Not_found -> None) in
160+
let extract_fun f2 = match follow f2.cf_type with
161+
| TFun (args,ret,coro) -> args, ret, coro
162+
| _ -> die "" __LOC__
163+
in
160164
match f2,fd with
161165
| Some (f2), Some(fd) ->
162-
let targs, tret = (match follow f2.cf_type with TFun (args,ret) -> args, ret | _ -> die "" __LOC__) in
166+
let targs, tret, coro = extract_fun f2 in
163167
let changed_args = ref [] in
164168
let prefix = "_tmp_" in
165169
let nargs = List.map2 (fun ((v,ct) as cur) (_,_,t2) ->
@@ -197,10 +201,10 @@ let fix_override com c f fd =
197201
let targs = List.map (fun(v,c) -> (v.v_name, Option.is_some c, v.v_type)) nargs in
198202
let fde = (match f.cf_expr with None -> die "" __LOC__ | Some e -> e) in
199203
f.cf_expr <- Some { fde with eexpr = TFunction fd2 };
200-
f.cf_type <- TFun(targs,tret);
204+
f.cf_type <- TFun(targs,tret,coro);
201205
| Some(f2), None when (has_class_flag c CInterface) ->
202-
let targs, tret = (match follow f2.cf_type with TFun (args,ret) -> args, ret | _ -> die "" __LOC__) in
203-
f.cf_type <- TFun(targs,tret)
206+
let targs, tret, coro = extract_fun f2 in
207+
f.cf_type <- TFun(targs,tret,coro)
204208
| _ ->
205209
()
206210

@@ -334,7 +338,7 @@ module Dump = struct
334338
| Some e -> " = " ^ (s_cf_expr f));
335339
| Method m -> if ((has_class_flag c CExtern) || (has_class_flag c CInterface)) then (
336340
match f.cf_type with
337-
| TFun(al,t) -> print "(%s):%s;" (String.concat ", " (
341+
| TFun(al,t,_) -> print "(%s):%s;" (String.concat ", " (
338342
List.map (fun (n,o,t) -> n ^ ":" ^ (s_type t)) al))
339343
(s_type t)
340344
| _ -> ()
@@ -365,7 +369,7 @@ module Dump = struct
365369
let f = PMap.find n e.e_constrs in
366370
print "\t%s%s;\n" f.ef_name (
367371
match f.ef_type with
368-
| TFun (al,t) -> Printf.sprintf "(%s)" (String.concat ", "
372+
| TFun (al,t,_) -> Printf.sprintf "(%s)" (String.concat ", "
369373
(List.map (fun (n,o,t) -> (if o then "?" else "") ^ n ^ ":" ^ (s_type t)) al))
370374
| _ -> "")
371375
) e.e_names;
@@ -502,7 +506,7 @@ module UnificationCallback = struct
502506
List.rev (loop [] el tl)
503507

504508
let check_call f el t = match follow t with
505-
| TFun(args,_) ->
509+
| TFun(args,_,_) ->
506510
check_call_params f el args
507511
| _ ->
508512
List.map (fun e -> f e t_dynamic) el

src/codegen/gencommon/castDetect.ml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ let rec type_eq gen param a b =
176176
| TInst (c1,tl1) , TInst (c2,tl2) ->
177177
if c1 != c2 && not (param = EqCoreType && c1.cl_path = c2.cl_path) && (match c1.cl_kind, c2.cl_kind with KExpr _, KExpr _ -> false | _ -> true) then Type.error [cannot_unify a b];
178178
List.iter2 (type_eq gen param) tl1 tl2
179-
| TFun (l1,r1) , TFun (l2,r2) when List.length l1 = List.length l2 ->
179+
| TFun (l1,r1,coro1) , TFun (l2,r2,coro2) when coro1 = coro2 && List.length l1 = List.length l2 ->
180180
(try
181181
type_eq gen param r1 r2;
182182
List.iter2 (fun (n,o1,t1) (_,o2,t2) ->
@@ -513,7 +513,7 @@ let rec handle_cast gen e real_to_t real_from_t =
513513
e
514514
else
515515
mk_cast true to_t e
516-
| TFun(args, ret), TFun(args2, ret2) ->
516+
| TFun(args, ret, coro1), TFun(args2, ret2, coro2) when coro1 = coro2 ->
517517
let get_args = List.map (fun (_,_,t) -> t) in
518518
(try List.iter2 (type_eq gen (EqBothDynamic)) (ret :: get_args args) (ret2 :: get_args args2); e with | Unify_error _ | Invalid_argument _ -> mk_cast true to_t e)
519519
| _, _ ->
@@ -611,7 +611,7 @@ let choose_ctor gen cl tparams etl maybe_empty_t p =
611611
let count = ref 0 in
612612
let is_empty_call = Type.type_iseq t empty_t in
613613
let ret = List.filter (fun cf -> match follow cf.cf_type with
614-
| TFun([_,_,t],_) ->
614+
| TFun([_,_,t],_,_) ->
615615
replace_mono t; incr count; is_empty_call = (Type.type_iseq t empty_t)
616616
| _ -> false) ctors
617617
in
@@ -690,7 +690,7 @@ let change_rest tfun elist =
690690
List.rev acc
691691
in
692692
let args,ret = get_fun tfun in
693-
TFun(loop [] args elist, ret)
693+
TFun(loop [] args elist, ret, false)
694694

695695
let fastcast_if_needed gen expr real_to_t real_from_t =
696696
if Common.defined gen.gcon Define.FastCast then begin
@@ -724,7 +724,7 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
724724
efield
725725
| Some ecall ->
726726
match follow efield.etype with
727-
| TFun(_,ret) ->
727+
| TFun(_,ret,_) ->
728728
(* closures will be handled by the closure handler. So we will just hint what's the expected type *)
729729
(* FIXME: should closures have also its arguments cast correctly? In the current implementation I think not. TO_REVIEW *)
730730
handle_cast gen { ecall with eexpr = TCall(efield, elist) } (gen.greal_type ecall.etype) ret
@@ -741,7 +741,7 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
741741
let args_list args = (if not calls_parameters_explicitly then t_dynamic else snd args) :: (List.map (fun (n,o,t) -> t) (fst args)) in
742742

743743
let monos = List.map (fun _ -> mk_mono()) params in
744-
let original = args_list (get_fun (apply_params params monos (TFun(fst original_args,snd original_args)))) in
744+
let original = args_list (get_fun (apply_params params monos (TFun(fst original_args,snd original_args,false)))) in
745745
let applied = args_list applied_args in
746746

747747
(try
@@ -865,7 +865,7 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
865865
else begin
866866
(* infer arguments *)
867867
(* let called_t = TFun(List.map (fun e -> "arg",false,e.etype) elist, ecall.etype) in *)
868-
let called_t = match follow e1.etype with | TFun _ -> e1.etype | _ -> TFun(List.map (fun e -> "arg",false,e.etype) elist, ecall.etype) in (* workaround for issue #1742 *)
868+
let called_t = match follow e1.etype with | TFun _ -> e1.etype | _ -> TFun(List.map (fun e -> "arg",false,e.etype) elist, ecall.etype, false) in (* workaround for issue #1742 *)
869869
let called_t = change_rest called_t elist in
870870
let original = (get_fun (apply_params cl.cl_params params actual_t)) in
871871
let applied = (get_fun called_t) in
@@ -935,7 +935,7 @@ let handle_type_parameter gen e e1 ef ~clean_ef ~overloads_cast_to_base f elist
935935
let pt = match e with | None -> real_type | Some _ -> snd (get_fun e1.etype) in
936936
let _params = match follow pt with | TEnum(_, p) -> p | _ -> gen.gcon.warning (debug_expr e1) e1.epos; die "" __LOC__ in
937937
let args, ret = get_fun efield.ef_type in
938-
let actual_t = TFun(List.map (fun (n,o,t) -> (n,o,gen.greal_type t)) args, gen.greal_type ret) in
938+
let actual_t = TFun(List.map (fun (n,o,t) -> (n,o,gen.greal_type t)) args, gen.greal_type ret, false) in
939939
(*
940940
because of differences on how <Dynamic> is handled on the platforms, this is a hack to be able to
941941
correctly use class field type parameters with RealTypeParams
@@ -1158,14 +1158,14 @@ let configure gen ?(overloads_cast_to_base = false) maybe_empty_t calls_paramete
11581158
let args,rt = get_fun (apply_params sup.cl_params stl cf.cf_type) in
11591159
let eparams = List.map2 (fun e (_,_,t) ->
11601160
handle (run e) t e.etype
1161-
) (wrap_rest_args gen (TFun (args,rt)) eparams e.epos) args in
1161+
) (wrap_rest_args gen (TFun (args,rt,false)) eparams e.epos) args in
11621162
{ e with eexpr = TCall(ef, eparams) }
11631163
with | Not_found ->
11641164
gen.gcon.warning "No overload found for this constructor call" e.epos;
11651165
{ e with eexpr = TCall(ef, List.map run eparams) })
11661166
| TCall (ef, eparams) ->
11671167
(match ef.etype with
1168-
| TFun(p, ret) ->
1168+
| TFun(p, ret, _) ->
11691169
handle ({ e with eexpr = TCall(run ef, List.map2 (fun param (_,_,t) -> handle (run param) t param.etype) eparams p) }) e.etype ret
11701170
| _ -> Type.map_expr run e
11711171
)
@@ -1186,7 +1186,7 @@ let configure gen ?(overloads_cast_to_base = false) maybe_empty_t calls_paramete
11861186
let args,rt = get_fun (apply_params sup.cl_params stl cf.cf_type) in
11871187
let eparams = List.map2 (fun e (_,_,t) ->
11881188
handle (run e) t e.etype
1189-
) (wrap_rest_args gen (TFun (args,rt)) eparams e.epos) args in
1189+
) (wrap_rest_args gen (TFun (args,rt,false)) eparams e.epos) args in
11901190
{ e with eexpr = TNew(cl, tparams, eparams) }
11911191
with | Not_found ->
11921192
gen.gcon.warning "No overload found for this constructor call" e.epos;

src/codegen/gencommon/closuresToClass.ml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ let rec cleanup_delegate e = match e.eexpr with
106106
| _ -> e
107107

108108
let funct gen t = match follow (run_follow gen t) with
109-
| TFun(args,ret) -> args,ret
109+
| TFun(args,ret,_) -> args,ret
110110
| _ -> raise Not_found
111111

112112
let mk_conversion_fun gen e =
@@ -235,7 +235,7 @@ let traverse gen ?tparam_anon_decl ?tparam_anon_acc (handle_anon_func:texpr->tfu
235235
dynamic_func_call { e with eexpr = TCall(run e1, List.map run params) }
236236
| _ ->
237237
let i = ref 0 in
238-
let t = TFun(List.map (fun e -> incr i; "arg" ^ (string_of_int !i), false, e.etype) params, e.etype) in
238+
let t = TFun(List.map (fun e -> incr i; "arg" ^ (string_of_int !i), false, e.etype) params, e.etype, false) in
239239
dynamic_func_call { e with eexpr = TCall( mk_castfast t (run e1), List.map run params ) }
240240
)
241241
(* | FNotFound ->
@@ -247,7 +247,7 @@ let traverse gen ?tparam_anon_decl ?tparam_anon_acc (handle_anon_func:texpr->tfu
247247
dynamic_func_call { e with eexpr = TCall(run e1, List.map run params) }
248248
| _ ->
249249
let i = ref 0 in
250-
let t = TFun(List.map (fun e -> incr i; "arg" ^ (string_of_int !i), false, e.etype) params, e.etype) in
250+
let t = TFun(List.map (fun e -> incr i; "arg" ^ (string_of_int !i), false, e.etype) params, e.etype, false) in
251251
dynamic_func_call { e with eexpr = TCall( mk_castfast t (run e1), List.map run params ) }
252252
)
253253
| TFunction tf ->
@@ -264,7 +264,7 @@ let traverse gen ?tparam_anon_decl ?tparam_anon_acc (handle_anon_func:texpr->tfu
264264
let t = TFun(List.map (fun e ->
265265
incr i;
266266
("p" ^ (string_of_int !i), false, e.etype)
267-
) params, e.etype)
267+
) params, e.etype, false)
268268
in
269269
fun e -> mk_castfast t e
270270
in
@@ -281,7 +281,7 @@ let rec get_type_params acc t =
281281
| TInst(( { cl_kind = KTypeParameter constraints } as cl), []) ->
282282
let params = List.fold_left get_type_params acc constraints in
283283
List.filter (fun t -> not (List.memq t acc)) (cl :: params) @ acc;
284-
| TFun (params,tret) ->
284+
| TFun (params,tret,_) ->
285285
List.fold_left get_type_params acc ( tret :: List.map (fun (_,_,t) -> t) params )
286286
| TDynamic t ->
287287
(match t with | TDynamic _ -> acc | _ -> get_type_params acc t)
@@ -325,7 +325,7 @@ let get_captured expr =
325325
| TFunction(tf) ->
326326
List.iter (fun (v,_) -> Hashtbl.add ignored v.v_id v) tf.tf_args;
327327
(match follow expr.etype with
328-
| TFun(args,ret) ->
328+
| TFun(args,ret,_) ->
329329
List.iter (fun (_,_,t) ->
330330
check_params t
331331
) args;
@@ -466,7 +466,7 @@ let configure gen ft =
466466
ifield,ifield,sa
467467
| Some _ ->
468468
let pos = cls.cl_pos in
469-
let cf = mk_class_field "Delegate" (TFun(fun_args tfunc.tf_args, tfunc.tf_type)) true pos (Method MethNormal) [] in
469+
let cf = mk_class_field "Delegate" (TFun(fun_args tfunc.tf_args, tfunc.tf_type, false)) true pos (Method MethNormal) [] in
470470
cf.cf_expr <- Some { fexpr with eexpr = TFunction { tfunc with tf_expr = func_expr }; };
471471
add_class_field_flag cf CfFinal;
472472
cls.cl_ordered_fields <- cf :: cls.cl_ordered_fields;
@@ -506,7 +506,7 @@ let configure gen ft =
506506
epos = pos;
507507
} in
508508

509-
let ctor_type = (TFun(ctor_sig, gen.gcon.basic.tvoid)) in
509+
let ctor_type = (TFun(ctor_sig, gen.gcon.basic.tvoid, false)) in
510510
let ctor = mk_class_field "new" ctor_type true cls.cl_pos (Method(MethNormal)) [] in
511511
ctor.cf_expr <- Some(
512512
{
@@ -789,13 +789,13 @@ struct
789789
UPDATE: the fix will be that Int64 won't be a typedef to Float/Int
790790
*)
791791
let changed_sig, arity, type_number, changed_sig_ret, is_void, is_dynamic_func = match follow old_sig with
792-
| TFun(_sig, ret) ->
792+
| TFun(_sig, ret, coro) ->
793793
let type_n, ret_t = rettype_real_to_func ret in
794794
let arity = List.length _sig in
795795
let is_dynamic_func = arity >= max_arity in
796796
let ret_t = if is_dynamic_func then t_dynamic else ret_t in
797797

798-
(TFun(args_real_to_func_sig _sig, ret_t), arity, type_n, ret_t, ExtType.is_void ret, is_dynamic_func)
798+
(TFun(args_real_to_func_sig _sig, ret_t, coro), arity, type_n, ret_t, ExtType.is_void ret, is_dynamic_func)
799799
| _ -> (print_endline (s_type (print_context()) (follow old_sig) )); die "" __LOC__
800800
in
801801

@@ -868,12 +868,12 @@ struct
868868
let invoke_fun = if params_len >= max_arity then "invokeDynamic" else "invoke" ^ (string_of_int params_len) ^ postfix in
869869
let invoke_fun = mk_internal_name "hx" invoke_fun in
870870
let fun_t = match follow tc.etype with
871-
| TFun(_sig, _) ->
872-
TFun(args_real_to_func_sig _sig, ret_t)
871+
| TFun(_sig, _, coro) ->
872+
TFun(args_real_to_func_sig _sig, ret_t, coro)
873873
| _ ->
874874
let i = ref 0 in
875875
let _sig = List.map (fun p -> let name = "arg" ^ (string_of_int !i) in incr i; (name,false,p.etype) ) params in
876-
TFun(args_real_to_func_sig _sig, ret_t)
876+
TFun(args_real_to_func_sig _sig, ret_t, false)
877877
in
878878

879879
let may_cast = match follow call_expr.etype with
@@ -904,7 +904,7 @@ struct
904904
let mk_this field t = { (mk_field_access gen this field pos) with etype = t } in
905905

906906
let mk_invoke_i i is_float =
907-
let cf = mk_class_field (iname i is_float) (TFun(func_sig_i i, if is_float then basic.tfloat else t_dynamic)) false pos (Method MethNormal) [] in
907+
let cf = mk_class_field (iname i is_float) (TFun(func_sig_i i, (if is_float then basic.tfloat else t_dynamic),false)) false pos (Method MethNormal) [] in
908908
cf
909909
in
910910

@@ -963,7 +963,7 @@ struct
963963

964964
let fn_expr = map_fn i ret (List.map fst args) api in
965965

966-
let t = TFun(fun_args args, ret) in
966+
let t = TFun(fun_args args, ret, false) in
967967

968968
let tfunction =
969969
{
@@ -1010,7 +1010,7 @@ struct
10101010
in
10111011

10121012
let args = [dynamic_arg, None] in
1013-
let dyn_t = TFun(fun_args args, t_dynamic) in
1013+
let dyn_t = TFun(fun_args args, t_dynamic, false) in
10141014
let dyn_cf = mk_class_field (mk_internal_name "hx" "invokeDynamic") dyn_t false pos (Method MethNormal) [] in
10151015

10161016
dyn_cf.cf_expr <- Some {
@@ -1024,7 +1024,7 @@ struct
10241024
};
10251025

10261026
let additional_cfs = begin
1027-
let new_t = TFun(["arity", false, basic.tint; "type", false, basic.tint],basic.tvoid) in
1027+
let new_t = TFun(["arity", false, basic.tint; "type", false, basic.tint],basic.tvoid, false) in
10281028
let new_cf = mk_class_field "new" (new_t) true pos (Method MethNormal) [] in
10291029
let v_arity, v_type = alloc_var "arity" basic.tint, alloc_var "type" basic.tint in
10301030
let mk_assign v field = mk (TBinop (OpAssign, mk_this field v.v_type, mk_local v pos)) v.v_type pos in
@@ -1095,7 +1095,7 @@ struct
10951095
let mk_this field t = { (mk_field_access gen this field pos) with etype = t } in
10961096

10971097
let mk_invoke_switch i api =
1098-
let t = TFun (func_sig_i i, t_dynamic) in
1098+
let t = TFun (func_sig_i i, t_dynamic, false) in
10991099
(* case i: return this.invokeX_o(0, 0, 0, 0, 0, ... arg[0], args[1]....); *)
11001100
[make_int gen.gcon.basic i pos], mk_return (mk (TCall(mk_this (iname i false) t, mk_dyn_call i api)) t_dynamic pos)
11011101
in
@@ -1109,7 +1109,7 @@ struct
11091109
let type_name = mk_internal_name "fn" "type" in
11101110
let mk_expr i is_float vars =
11111111
let call_expr =
1112-
let call_t = TFun(List.map (fun v -> (v.v_name, false, v.v_type)) vars, if is_float then t_dynamic else basic.tfloat) in
1112+
let call_t = TFun(List.map (fun v -> (v.v_name, false, v.v_type)) vars, (if is_float then t_dynamic else basic.tfloat), false) in
11131113
{
11141114
eexpr = TCall(mk_this (iname i (not is_float)) call_t, List.map (fun v -> mk_local v pos) vars);
11151115
etype = if is_float then t_dynamic else basic.tfloat;

src/codegen/gencommon/enumToClass.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ struct
118118
incr i;
119119

120120
let cf = match follow ef.ef_type with
121-
| TFun(params,ret) ->
121+
| TFun(params,ret,_) ->
122122
let dup_types =
123123
if handle_type_params then
124124
List.map (fun (s,t) -> (s, TInst (map_param (get_cl_t t), []))) en.e_params

src/codegen/gencommon/enumToClass2.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ module EnumToClass2Modf = struct
108108
let etag = make_string gen.gcon.basic name pos in
109109
let efields = ref [] in
110110
(match follow ef.ef_type with
111-
| TFun(_, _) ->
111+
| TFun(_, _, _) ->
112112
(* erase type params *)
113113
let ef_type =
114114
let t = apply_params en.e_params (List.map (fun _ -> t_dynamic) en.e_params) ef.ef_type in
@@ -162,7 +162,7 @@ module EnumToClass2Modf = struct
162162

163163
ctor_block := (mk (TCall(esuper,[make_int gen.gcon.basic index pos])) basic.tvoid pos) :: !ctor_block;
164164

165-
let cf_ctor_t = TFun (params, basic.tvoid) in
165+
let cf_ctor_t = TFun (params, basic.tvoid, false) in
166166
let cf_ctor = mk_class_field "new" cf_ctor_t true pos (Method MethNormal) [] in
167167
cf_ctor.cf_expr <- Some {
168168
eexpr = TFunction {
@@ -175,7 +175,7 @@ module EnumToClass2Modf = struct
175175
};
176176
cl_ctor.cl_constructor <- Some cf_ctor;
177177

178-
let cf_toString_t = TFun ([],basic.tstring) in
178+
let cf_toString_t = TFun ([],basic.tstring,false) in
179179
let cf_toString = mk_class_field "toString" cf_toString_t true pos (Method MethNormal) [] in
180180

181181
let etoString_args = mk_array_decl t_dynamic !efields pos in
@@ -227,7 +227,7 @@ module EnumToClass2Modf = struct
227227
equals_exprs := (List.rev !param_equal_checks) @ !equals_exprs;
228228
equals_exprs := mk_return (make_bool gen.gcon.basic true pos) :: !equals_exprs;
229229

230-
let cf_Equals_t = TFun([("other",false,t_dynamic)],basic.tbool) in
230+
let cf_Equals_t = TFun([("other",false,t_dynamic)],basic.tbool,false) in
231231
let cf_Equals = mk_class_field "Equals" cf_Equals_t true pos (Method MethNormal) [] in
232232
cf_Equals.cf_expr <- Some {
233233
eexpr = TFunction {
@@ -243,7 +243,7 @@ module EnumToClass2Modf = struct
243243

244244
(* add GetHashCode field *)
245245
begin
246-
let cf_GetHashCode_t = TFun([],basic.tint) in
246+
let cf_GetHashCode_t = TFun([],basic.tint,false) in
247247
let cf_GetHashCode = mk_class_field "GetHashCode" cf_GetHashCode_t true pos (Method MethNormal) [] in
248248
cf_GetHashCode.cf_expr <- Some {
249249
eexpr = TFunction {
@@ -260,7 +260,7 @@ module EnumToClass2Modf = struct
260260
end
261261

262262
| _ ->
263-
let cf_ctor_t = TFun([], basic.tvoid) in
263+
let cf_ctor_t = TFun([], basic.tvoid,false) in
264264
let cf_ctor = mk_class_field "new" cf_ctor_t true pos (Method MethNormal) [] in
265265
cf_ctor.cf_expr <- Some {
266266
eexpr = TFunction {
@@ -376,7 +376,7 @@ module EnumToClass2Exprf = struct
376376
let ecast = mk (TCall (mk (TIdent "__as__") t_dynamic f.epos, [f])) (TInst (cl_ctor, [])) f.epos in
377377

378378
(match ef.ef_type with
379-
| TFun (params, _) ->
379+
| TFun (params, _, _) ->
380380
let fname, _, _ = List.nth params i in
381381
field ecast fname e.etype e.epos
382382
| _ -> Globals.die "" __LOC__)

0 commit comments

Comments
 (0)