Skip to content

Commit

Permalink
disable unused warnings for identifiers defined in the toplevel
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.00@12396 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
Jacques Garrigue committed Apr 25, 2012
1 parent f3e4cae commit 63578b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions toplevel/toploop.ml
Expand Up @@ -218,8 +218,10 @@ let execute_phrase print_outcome ppf phr =
| Ptop_def sstr ->
let oldenv = !toplevel_env in
Typecore.reset_delayed_checks ();
let (str, sg, newenv) = Typemod.type_structure oldenv sstr Location.none
in
let (str, sg, newenv) =
Typemod.type_structure oldenv sstr Location.none in
let _ =
Includemod.compunit "//toplevel//" sg "(inferred signature)" sg in
Typecore.force_delayed_checks ();
let lam = Translmod.transl_toplevel_definition str in
Warnings.check_fatal ();
Expand Down
11 changes: 8 additions & 3 deletions typing/typedecl.ml
Expand Up @@ -766,12 +766,17 @@ let transl_type_decl env name_sdecl_list =
(fun old_callback ->
match !current_slot with
| Some slot -> slot := (name, td) :: !slot
| None -> List.iter (fun (name, d) -> Env.mark_type_used name d) (get_ref slot); old_callback ()
| None ->
List.iter (fun (name, d) -> Env.mark_type_used name d)
(get_ref slot);
old_callback ()
);
id, Some slot
in
let transl_declaration name_sdecl (id, slot) = current_slot := slot; transl_declaration temp_env name_sdecl id in
let decls = List.map2 transl_declaration name_sdecl_list (List.map id_slots id_list) in
let transl_declaration name_sdecl (id, slot) =
current_slot := slot; transl_declaration temp_env name_sdecl id in
let decls =
List.map2 transl_declaration name_sdecl_list (List.map id_slots id_list) in
current_slot := None;
(* Check for duplicates *)
check_duplicates name_sdecl_list;
Expand Down

0 comments on commit 63578b1

Please sign in to comment.