diff options
| author | Pierre-Marie Pédrot | 2019-05-26 02:12:01 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2019-05-27 14:14:56 +0200 |
| commit | bd21ec85ff71e49b12d48e4ed3bf72a3f48a60d2 (patch) | |
| tree | a255f493ebe3b2072a275b5b31f1ac2a422fc200 | |
| parent | c371b6f0bc6aa75fb3fe138d2bd52bdd189550b1 (diff) | |
Ensure dynamically that opaque definitions come with their type.
The only lawbreaker was the Add Ring command. We generate a type for
the declaration to fix the code.
| -rw-r--r-- | kernel/term_typing.ml | 1 | ||||
| -rw-r--r-- | plugins/setoid_ring/newring.ml | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/kernel/term_typing.ml b/kernel/term_typing.ml index 088dd98db8..af2c511db9 100644 --- a/kernel/term_typing.ml +++ b/kernel/term_typing.ml @@ -169,6 +169,7 @@ the polymorphic case | DefinitionEntry c -> let { const_entry_type = typ; const_entry_opaque = opaque ; _ } = c in let { const_entry_body = body; const_entry_feedback = feedback_id; _ } = c in + let () = assert (not (opaque && Option.is_empty typ)) in let (body, ctx), side_eff = Future.join body in let body, ctx = match trust with | Pure -> body, ctx diff --git a/plugins/setoid_ring/newring.ml b/plugins/setoid_ring/newring.ml index aeceeb4e50..8e7b045b8e 100644 --- a/plugins/setoid_ring/newring.ml +++ b/plugins/setoid_ring/newring.ml @@ -153,9 +153,11 @@ let decl_constant na univs c = let open Constr in let vars = CVars.universes_of_constr c in let univs = UState.restrict_universe_context univs vars in - let univs = Monomorphic_entry univs in + let () = Declare.declare_universe_context false univs in + let types = (Typeops.infer (Global.env ()) c).uj_type in + let univs = Monomorphic_entry Univ.ContextSet.empty in mkConst(declare_constant (Id.of_string na) - (DefinitionEntry (definition_entry ~opaque:true ~univs c), + (DefinitionEntry (definition_entry ~opaque:true ~types ~univs c), IsProof Lemma)) (* Calling a global tactic *) |
