Skip to content

Commit

Permalink
UState: don't check for unbound qualities as it doesn't make sense
Browse files Browse the repository at this point in the history
due to collapsing qualities any quality we see must be named

Fix #19072

(we still have a check in the functions used by rewrite rules, not
sure if it's correct there but probably doesn't matter)
  • Loading branch information
SkySkimmer committed May 22, 2024
1 parent f1649da commit 7d74a5b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions engine/uState.ml
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,10 @@ let universe_context_inst decl qvars levels names =
let leftus = List.fold_left (fun acc l -> Level.Set.remove l acc) levels decl.univdecl_instance in
let () =
let unboundus = if decl.univdecl_extensible_instance then Level.Set.empty else leftus in
if not (QVar.Set.is_empty leftqs && Level.Set.is_empty unboundus)
then error_unbound_universes leftqs unboundus names
(* allow unbound qualities, cf #19072
collapsing ensured that we only get named qualities anyway *)
if not (Level.Set.is_empty unboundus)
then error_unbound_universes QVar.Set.empty unboundus names
in
let leftqs = UContext.sort_qualities
(Array.map_of_list (fun q -> Quality.QVar q) (QVar.Set.elements leftqs))
Expand Down
15 changes: 15 additions & 0 deletions test-suite/bugs/bug_19072.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Set Universe Polymorphism.

Definition demo@{srt|u |} : True.
Proof.
abstract exact I.
Defined.

(* abstract doesn't restrict named qualities and universes
(debatable behaviour but that's what it does currently) *)
Check demo@{Type|Set}.

Definition baz@{q|u|} (A:Type@{q|u}) (x:A) : A.
Proof.
abstract exact x.
Defined.

0 comments on commit 7d74a5b

Please sign in to comment.