aboutsummaryrefslogtreecommitdiff
path: root/vernac/comDefinition.ml
diff options
context:
space:
mode:
Diffstat (limited to 'vernac/comDefinition.ml')
-rw-r--r--vernac/comDefinition.ml10
1 files changed, 6 insertions, 4 deletions
diff --git a/vernac/comDefinition.ml b/vernac/comDefinition.ml
index 81154bbea9..c54adb45f9 100644
--- a/vernac/comDefinition.ml
+++ b/vernac/comDefinition.ml
@@ -110,9 +110,10 @@ let interp_definition ~program_mode env evd impl_env bl red_option c ctypopt =
let tyopt = Option.map (fun ty -> EConstr.it_mkProd_or_LetIn ty ctx) tyopt in
evd, (c, tyopt), imps
-let do_definition ?hook ~name ~scope ~poly ~kind ?using udecl bl red_option c ctypopt =
+let do_definition ?hook ~name ~scope ~poly ?typing_flags ~kind ?using udecl bl red_option c ctypopt =
let program_mode = false in
let env = Global.env() in
+ let env = Environ.update_typing_flags ?typing_flags env in
(* Explicitly bound universes and constraints *)
let evd, udecl = interp_univ_decl_opt env udecl in
let evd, (body, types), impargs =
@@ -125,14 +126,15 @@ let do_definition ?hook ~name ~scope ~poly ~kind ?using udecl bl red_option c ct
in
let kind = Decls.IsDefinition kind in
let cinfo = Declare.CInfo.make ~name ~impargs ~typ:types ?using () in
- let info = Declare.Info.make ~scope ~kind ?hook ~udecl ~poly () in
+ let info = Declare.Info.make ~scope ~kind ?hook ~udecl ~poly ?typing_flags () in
let _ : Names.GlobRef.t =
Declare.declare_definition ~info ~cinfo ~opaque:false ~body evd
in ()
-let do_definition_program ?hook ~pm ~name ~scope ~poly ~kind ?using udecl bl red_option c ctypopt =
+let do_definition_program ?hook ~pm ~name ~scope ~poly ?typing_flags ~kind ?using udecl bl red_option c ctypopt =
let program_mode = true in
let env = Global.env() in
+ let env = Environ.update_typing_flags ?typing_flags env in
(* Explicitly bound universes and constraints *)
let evd, udecl = interp_univ_decl_opt env udecl in
let evd, (body, types), impargs =
@@ -146,6 +148,6 @@ let do_definition_program ?hook ~pm ~name ~scope ~poly ~kind ?using udecl bl red
let term, typ, uctx, obls = Declare.Obls.prepare_obligation ~name ~body ~types evd in
let pm, _ =
let cinfo = Declare.CInfo.make ~name ~typ ~impargs ?using () in
- let info = Declare.Info.make ~udecl ~scope ~poly ~kind ?hook () in
+ let info = Declare.Info.make ~udecl ~scope ~poly ~kind ?hook ?typing_flags () in
Declare.Obls.add_definition ~pm ~cinfo ~info ~term ~uctx obls
in pm