|
@@ -3810,12 +3810,12 @@ and maybe_type_against_enum ctx f with_type iscall p =
|
|
|
| WithType t ->
|
|
|
let rec loop stack t = match follow t with
|
|
|
| TEnum (en,_) ->
|
|
|
- en.e_path,en.e_names,TEnumDecl en
|
|
|
+ true,en.e_path,en.e_names,TEnumDecl en
|
|
|
| TAbstract ({a_impl = Some c} as a,_) when has_meta Meta.Enum a.a_meta ->
|
|
|
let fields = ExtList.List.filter_map (fun cf ->
|
|
|
if Meta.has Meta.Enum cf.cf_meta then Some cf.cf_name else None
|
|
|
) c.cl_ordered_statics in
|
|
|
- a.a_path,fields,TAbstractDecl a
|
|
|
+ false,a.a_path,fields,TAbstractDecl a
|
|
|
| TAbstract (a,pl) when not (Meta.has Meta.CoreType a.a_meta) ->
|
|
|
begin match get_abstract_froms a pl with
|
|
|
| [t2] ->
|
|
@@ -3826,7 +3826,7 @@ and maybe_type_against_enum ctx f with_type iscall p =
|
|
|
| _ ->
|
|
|
raise Exit
|
|
|
in
|
|
|
- let path,fields,mt = loop [] t in
|
|
|
+ let is_enum,path,fields,mt = loop [] t in
|
|
|
let old = ctx.m.curmod.m_types in
|
|
|
let restore () = ctx.m.curmod.m_types <- old in
|
|
|
ctx.m.curmod.m_types <- ctx.m.curmod.m_types @ [mt];
|
|
@@ -3845,7 +3845,7 @@ and maybe_type_against_enum ctx f with_type iscall p =
|
|
|
begin match e with
|
|
|
| AKExpr e ->
|
|
|
begin match follow e.etype with
|
|
|
- | TFun(_,t') ->
|
|
|
+ | TFun(_,t') when is_enum ->
|
|
|
unify ctx t' t e.epos;
|
|
|
AKExpr e
|
|
|
| _ ->
|