diff options
author | Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net> | 2017-12-05 20:22:14 +0100 |
---|---|---|
committer | Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net> | 2017-12-06 13:23:31 +0100 |
commit | 5b8b02cd060097c3c980b0498257c30eda1ad207 (patch) | |
tree | ff0e51230d3518bb2db523187644cd73d40aecf5 /vernac/obligations.ml | |
parent | 2c5e81e3bc6ec17d253aeedd1b2bf4ccd3b81933 (diff) |
Fix #6323: stronger restrict universe context vs abstract.
In the test we do [let X : Type@{i} := Set in ...] with Set
abstracted. The constraint [Set < i] was lost in the abstract.
Universes of a monomorphic reference [c] are considered to appear in
the term [c].
Diffstat (limited to 'vernac/obligations.ml')
-rw-r--r-- | vernac/obligations.ml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vernac/obligations.ml b/vernac/obligations.ml index 24d664951..4f011e6ad 100644 --- a/vernac/obligations.ml +++ b/vernac/obligations.ml @@ -477,7 +477,10 @@ let declare_definition prg = let fix_exn = Hook.get get_fix_exn () in let typ = nf typ in let body = nf body in - let uvars = Univ.LSet.union (Univops.universes_of_constr typ) (Univops.universes_of_constr body) in + let env = Global.env () in + let uvars = Univ.LSet.union + (Univops.universes_of_constr env typ) + (Univops.universes_of_constr env body) in let uctx = UState.restrict prg.prg_ctx uvars in let univs = UState.check_univ_decl ~poly:(pi2 prg.prg_kind) uctx prg.prg_univdecl in let ce = definition_entry ~fix_exn ~opaque ~types:typ ~univs body in |