Browse Source

fixed issue #1299 for GADT

Nicolas Cannasse 12 năm trước cách đây
mục cha
commit
b5dde4fc32
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      typer.ml

+ 2 - 1
typer.ml

@@ -1655,7 +1655,8 @@ and type_expr_with_type_raise ?(print_error=true) ctx e t =
 				raise Exit
 			with Not_found -> try
 				let ef = PMap.find s e.e_constrs in
-				let constr = mk (TEnumField (e,s)) (apply_params e.e_types pl ef.ef_type) p in
+				let et = apply_params e.e_types pl (monomorphs ef.ef_params ef.ef_type) in
+				let constr = mk (TEnumField (e,s)) et p in
 				build_call ctx (AKExpr constr) el (Some t) p
 			with Not_found ->
 				if ctx.untyped then raise Exit; (* __js__, etc. *)