File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,27 @@ match n, parity n with
162162| _, Parity.even j => false :: natToBin j
163163| _, Parity.odd j => true :: natToBin j
164164
165+ -- Even with sparse matching, this can break
166+
167+ /--
168+ error: Tactic `cases` failed with a nested error:
169+ Dependent elimination failed: Failed to solve equation
170+ n✝¹.succ = n✝.add n✝
171+ at case `Parity.even` after processing
172+ (Nat.succ _), _
173+ the dependent pattern matcher can solve the following kinds of equations
174+ - <var> = <term> and <term> = <var>
175+ - <term> = <term> where the terms are definitionally equal
176+ - <constructor> = <constructor>, examples: List.cons x xs = List.cons y ys, and List.cons x xs = List.nil
177+ -/
178+ #guard_msgs in
179+ partial def natToBinBad2 (n : Nat) : List Bool :=
180+ match n, parity n with
181+ | 0 , _ => []
182+ | .succ 0 , _ => [true]
183+ | _, Parity.even j => false :: natToBin j
184+ | _, Parity.odd j => true :: natToBin j
185+
165186partial def natToBin2 (n : Nat) : List Bool :=
166187match n, parity n with
167188| _, Parity.even 0 => []
You can’t perform that action at this time.
0 commit comments