|
@@ -186,12 +186,17 @@ module Pattern = struct
|
|
ctx.locals <- PMap.add name v ctx.locals;
|
|
ctx.locals <- PMap.add name v ctx.locals;
|
|
v
|
|
v
|
|
in
|
|
in
|
|
|
|
+ let con_enum en ef p =
|
|
|
|
+ Display.DeprecationCheck.check_enum pctx.ctx.com en p;
|
|
|
|
+ Display.DeprecationCheck.check_ef pctx.ctx.com ef p;
|
|
|
|
+ ConEnum(en,ef)
|
|
|
|
+ in
|
|
let check_expr e =
|
|
let check_expr e =
|
|
let rec loop e = match e.eexpr with
|
|
let rec loop e = match e.eexpr with
|
|
| TField(_,FEnum(en,ef)) ->
|
|
| TField(_,FEnum(en,ef)) ->
|
|
(* Let the unification afterwards fail so we don't recover. *)
|
|
(* Let the unification afterwards fail so we don't recover. *)
|
|
(* (match follow ef.ef_type with TFun _ -> raise Exit | _ -> ()); *)
|
|
(* (match follow ef.ef_type with TFun _ -> raise Exit | _ -> ()); *)
|
|
- PatConstructor(ConEnum(en,ef),[])
|
|
|
|
|
|
+ PatConstructor(con_enum en ef e.epos,[])
|
|
| TField(_,FStatic(c,({cf_kind = Var {v_write = AccNever}} as cf))) ->
|
|
| TField(_,FStatic(c,({cf_kind = Var {v_write = AccNever}} as cf))) ->
|
|
PatConstructor(ConStatic(c,cf),[])
|
|
PatConstructor(ConStatic(c,cf),[])
|
|
| TConst ct ->
|
|
| TConst ct ->
|
|
@@ -322,7 +327,7 @@ module Pattern = struct
|
|
(* We want to change the original monomorphs back to type parameters, but we don't want to do that
|
|
(* We want to change the original monomorphs back to type parameters, but we don't want to do that
|
|
if they are bound to other monomorphs (issue #4578). *)
|
|
if they are bound to other monomorphs (issue #4578). *)
|
|
unapply_type_parameters ef.ef_params monos;
|
|
unapply_type_parameters ef.ef_params monos;
|
|
- PatConstructor(ConEnum(en,ef),patterns)
|
|
|
|
|
|
+ PatConstructor(con_enum en ef e1.epos,patterns)
|
|
| _ ->
|
|
| _ ->
|
|
fail()
|
|
fail()
|
|
end
|
|
end
|