lean4-htt/tests/lean/run/34.lean
Leonardo de Moura 306ff7d7e5 fix(library/compiler): fixes #34
`csimp` assumes constructors and `casesOn` applications match.  That
is, given `I.casesOn x ...`, then if `x` is an constructor, then it is
a constructor of the inductive datatype `I`.
The transformation `erase_irrelevant` was violating this property when
it mixes `Decidable` and `Bool`. We fix this issue by mapping
`Decidable.casesOn`, `Decidable.isTrue` and `Decidable.isFalse` to
`Bool.casesOn`, `Bool.true` and `Bool.false` respectively.
2019-09-13 10:20:50 -07:00

6 lines
137 B
Text

partial def foo : ∀ (n : Nat), State Unit Unit
| n =>
if n == 0 then pure () else
match n with
| 0 => pure ()
| n+1 => foo n