Skip to content

Commit a5b1988

Browse files
committed
forgot one
1 parent 21f2eec commit a5b1988

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/typing/typeloadFields.ml

+5-4
Original file line numberDiff line numberDiff line change
@@ -981,10 +981,11 @@ let check_abstract (ctx,cctx,fctx) a c cf fd t ret p =
981981
cf.cf_meta <- (Meta.MultiType,[],null_pos) :: cf.cf_meta;
982982
let r = make_lazy ctx.g t (fun () ->
983983
let args = if is_multitype_cast then begin
984-
let ctor = try
985-
PMap.find "_hx_new" c.cl_statics
986-
with Not_found ->
987-
raise_typing_error "Constructor of multi-type abstract must be defined before the individual @:to-functions are" cf.cf_pos
984+
let ctor = match a.a_constructor with
985+
| Some cf ->
986+
cf
987+
| None ->
988+
raise_typing_error "Constructor of multi-type abstract must be defined before the individual @:to-functions are" cf.cf_pos
988989
in
989990
(* delay ctx PFinal (fun () -> unify ctx m tthis f.cff_pos); *)
990991
let args = match follow (monomorphs a.a_params ctor.cf_type) with

0 commit comments

Comments
 (0)