aboutsummaryrefslogtreecommitdiff
path: root/vernac/declareDef.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2019-06-09 14:20:17 +0200
committerPierre-Marie Pédrot2019-06-09 14:20:17 +0200
commit1f81679d117446d32fcad8012e5613cb2377b359 (patch)
tree216bcc16b1cfce4d2a6ce1ce4356f3a5a7fffd0d /vernac/declareDef.ml
parent73c2dc60ccd4d64506250a9c7476740e97ab022c (diff)
parent1c52097ecfccd22b7515f0e197b747107874b372 (diff)
Merge PR #8726: More robust treatment of the Discharge status
Reviewed-by: aspiwack Ack-by: ejgallego Reviewed-by: ppedrot
Diffstat (limited to 'vernac/declareDef.ml')
-rw-r--r--vernac/declareDef.ml18
1 files changed, 2 insertions, 16 deletions
diff --git a/vernac/declareDef.ml b/vernac/declareDef.ml
index bdda3314ca..652dbf0858 100644
--- a/vernac/declareDef.ml
+++ b/vernac/declareDef.ml
@@ -14,27 +14,13 @@ open Entries
open Globnames
open Impargs
-let warn_local_declaration =
- CWarnings.create ~name:"local-declaration" ~category:"scope"
- Pp.(fun (id,kind) ->
- Names.Id.print id ++ strbrk " is declared as a local " ++ str kind)
-
-let get_locality id ~kind = function
-| Discharge ->
- (* If a Let is defined outside a section, then we consider it as a local definition *)
- warn_local_declaration (id,kind);
- true
-| Local -> true
-| Global -> false
-
let declare_definition ident (local, p, k) ?hook_data ce pl imps =
let fix_exn = Future.fix_exn_of ce.const_entry_body in
let gr = match local with
- | Discharge when Lib.sections_are_opened () ->
+ | Discharge ->
let _ = declare_variable ident (Lib.cwd(), SectionLocalDef ce, IsDefinition k) in
VarRef ident
- | Discharge | Local | Global ->
- let local = get_locality ident ~kind:"definition" local in
+ | Global local ->
let kn = declare_constant ident ~local (DefinitionEntry ce, IsDefinition k) in
let gr = ConstRef kn in
let () = Declare.declare_univ_binders gr pl in