Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore unused alternatives in Ord derive handler #3725

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Lean/Elab/Deriving/Ord.lean
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def mkMutualBlock (ctx : Context) : TermElabM Syntax := do
for i in [:ctx.typeInfos.size] do
auxDefs := auxDefs.push (← mkAuxFunction ctx i)
`(mutual
set_option match.ignoreUnusedAlts true
$auxDefs:command*
end)

Expand Down
13 changes: 13 additions & 0 deletions tests/lean/run/3706.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/--Ensure that `deriving Ord` works on indexed inductive types.-/
inductive Ty where
| int
| bool
inductive Expr : Ty → Type where
| a : Expr .int
| b : Expr .bool
deriving Ord

inductive Vec (α : Type u) : Nat → Type u
| nil : Vec α 0
| cons : α → {n : Nat} → Vec α n → Vec α (n+1)
deriving Ord
Loading