-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR generalizes the panic functions to a type of `Sort u` rather than `Type u`. This better supports universe polymorphic types and avoids confusing errors. An minimal (but somewhat contrived) example of such a confusing error is: ```lean /- stuck at solving universe constraint ?u.59+1 =?= max 1 ?u.7 while trying to unify Subtype.{?u.7} P : Sort (max 1 ?u.7) with Subtype.{?u.7} P : Sort (max 1 ?u.7) -/ def assertSubtype! {P : α → Prop} [Inhabited (Subtype P)] (a : α) [Decidable (P a)] : Subtype P := -- errors on := if h : P a then ⟨a, h⟩ else panic! "Property not satisified" ```
- Loading branch information
Showing
2 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters