|
@@ -194,7 +194,7 @@ let module_pass_1 ctx m tdecls loadp =
|
|
let com = ctx.com in
|
|
let com = ctx.com in
|
|
let decls = ref [] in
|
|
let decls = ref [] in
|
|
let statics = ref [] in
|
|
let statics = ref [] in
|
|
- let check_name name meta p =
|
|
|
|
|
|
+ let check_name name meta also_statics p =
|
|
DeprecationCheck.check_is com name meta p;
|
|
DeprecationCheck.check_is com name meta p;
|
|
let error prev_pos =
|
|
let error prev_pos =
|
|
display_error ctx ("Name " ^ name ^ " is already defined in this module") p;
|
|
display_error ctx ("Name " ^ name ^ " is already defined in this module") p;
|
|
@@ -203,12 +203,13 @@ let module_pass_1 ctx m tdecls loadp =
|
|
List.iter (fun (t2,(_,p2)) ->
|
|
List.iter (fun (t2,(_,p2)) ->
|
|
if snd (t_path t2) = name then error (t_infos t2).mt_name_pos
|
|
if snd (t_path t2) = name then error (t_infos t2).mt_name_pos
|
|
) !decls;
|
|
) !decls;
|
|
- List.iter (fun (d,_) ->
|
|
|
|
- if fst d.d_name = name then error (snd d.d_name)
|
|
|
|
- ) !statics
|
|
|
|
|
|
+ if also_statics then
|
|
|
|
+ List.iter (fun (d,_) ->
|
|
|
|
+ if fst d.d_name = name then error (snd d.d_name)
|
|
|
|
+ ) !statics
|
|
in
|
|
in
|
|
let make_path name priv meta p =
|
|
let make_path name priv meta p =
|
|
- check_name name meta p;
|
|
|
|
|
|
+ check_name name meta true p;
|
|
if priv then (fst m.m_path @ ["_" ^ snd m.m_path], name) else (fst m.m_path, name)
|
|
if priv then (fst m.m_path @ ["_" ^ snd m.m_path], name) else (fst m.m_path, name)
|
|
in
|
|
in
|
|
let has_declaration = ref false in
|
|
let has_declaration = ref false in
|
|
@@ -223,7 +224,7 @@ let module_pass_1 ctx m tdecls loadp =
|
|
if !has_declaration then error "import and using may not appear after a declaration" p;
|
|
if !has_declaration then error "import and using may not appear after a declaration" p;
|
|
acc
|
|
acc
|
|
| EStatic d ->
|
|
| EStatic d ->
|
|
- check_name (fst d.d_name) d.d_meta (snd d.d_name);
|
|
|
|
|
|
+ check_name (fst d.d_name) d.d_meta false (snd d.d_name);
|
|
has_declaration := true;
|
|
has_declaration := true;
|
|
statics := (d,p) :: !statics;
|
|
statics := (d,p) :: !statics;
|
|
acc;
|
|
acc;
|