Fix #7119 (@@@warning attribute not persistent from one toplevel phrase to the next one).

master
alainfrisch 2016-01-08 09:22:59 +01:00
parent 074daaee8e
commit b626516a32
2 changed files with 6 additions and 4 deletions

View File

@ -256,8 +256,10 @@ Toplevel and debugger:
(Valentin Gatien-Baron, review by Jérémie Dimino)
- PR#7098: Loss of ppx context in toplevel after an exception
(Alain Frisch, report by whitequark)
- PR#7101: The toplevel does not close in_channel for libraries specified on its command line
(Alain Frisch)
- PR#7101: The toplevel does not close in_channel for libraries specified on
its command line (Alain Frisch)
- PR#7119: ocaml doesn't respect [@@@warning] (Alain Frisch, report by
Gabriel Radanne)
Other libraries:
* Unix library: channels created by Unix.in_channel_of_descr or

View File

@ -1454,10 +1454,10 @@ and type_structure ?(toplevel = false) funct_body anchor env sstr scope =
(* moved to genannot *)
List.iter (function {pstr_loc = l} -> Stypes.record_phrase l) sstr;
let previous_saved_types = Cmt_format.get_saved_types () in
Builtin_attributes.warning_enter_scope ();
if not toplevel then Builtin_attributes.warning_enter_scope ();
let (items, sg, final_env) = type_struct env sstr in
let str = { str_items = items; str_type = sg; str_final_env = final_env } in
Builtin_attributes.warning_leave_scope ();
if not toplevel then Builtin_attributes.warning_leave_scope ();
Cmt_format.set_saved_types
(Cmt_format.Partial_structure str :: previous_saved_types);
str, sg, final_env