diff options
| author | Enrico Tassi | 2019-11-22 11:35:04 +0100 |
|---|---|---|
| committer | Enrico Tassi | 2019-12-24 09:09:16 +0100 |
| commit | f258a877d25c1f6a27875f26d9ea1fe0a5fb5b81 (patch) | |
| tree | 9dd48c5228d0da9eeb87305c03ba7ec82a235659 /vernac | |
| parent | 028d64fb5c461e32752b0f8a92d4e2eca2a26d0d (diff) | |
[CS] Allow a variable introduced with Let to be a canonical instance
Diffstat (limited to 'vernac')
| -rw-r--r-- | vernac/canonical.ml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vernac/canonical.ml b/vernac/canonical.ml index 141b02ef63..e41610b532 100644 --- a/vernac/canonical.ml +++ b/vernac/canonical.ml @@ -21,10 +21,12 @@ let cache_canonical_structure (_, (o,_)) = let sigma = Evd.from_env env in register_canonical_structure ~warn:true env sigma o -let discharge_canonical_structure (_,(x, local)) = - if local then None else Some (x, local) +let discharge_canonical_structure (_,((gref, _ as x), local)) = + if local || (Globnames.isVarRef gref && Lib.is_in_section gref) then None + else Some (x, local) -let inCanonStruc : (Constant.t * inductive) * bool -> obj = + +let inCanonStruc : (GlobRef.t * inductive) * bool -> obj = declare_object {(default_object "CANONICAL-STRUCTURE") with open_function = open_canonical_structure; cache_function = cache_canonical_structure; |
