|
@@ -1362,7 +1362,7 @@ let rec type_ident_raise ctx i p mode =
|
|
|
with Not_found -> try
|
|
|
(* static variable lookup *)
|
|
|
let f = PMap.find i ctx.curclass.cl_statics in
|
|
|
- if Meta.has Meta.Impl f.cf_meta && not (Meta.has Meta.Impl ctx.curfield.cf_meta) then
|
|
|
+ if Meta.has Meta.Impl f.cf_meta && not (Meta.has Meta.Impl ctx.curfield.cf_meta) && not (Meta.has Meta.Enum f.cf_meta) then
|
|
|
error (Printf.sprintf "Cannot access non-static field %s from static method" f.cf_name) p;
|
|
|
let e = type_type ctx ctx.curclass.cl_path p in
|
|
|
(* check_locals_masking already done in type_type *)
|