Guard one more instance of Env.add_type

master
Nicolás Ojeda Bär 2018-08-09 12:34:56 +02:00
parent dc5a38f8b0
commit 28284cdd6c
2 changed files with 3 additions and 2 deletions

View File

@ -1341,7 +1341,7 @@ let set_type_used_callback name td callback =
else let key = (name, loc) in
let old =
try Hashtbl.find type_declarations key
with Not_found -> assert false
with Not_found -> ignore
in
Hashtbl.replace type_declarations key (fun () -> callback old)

View File

@ -114,7 +114,8 @@ let enter_type rec_flag env sdecl id =
type_unboxed = unboxed_false_default_false;
}
in
Env.add_type ~check:true id decl env
Builtin_attributes.warning_scope decl.type_attributes
(fun () -> Env.add_type ~check:true id decl env)
let update_type temp_env env id loc =
let path = Path.Pident id in