lean4-htt/tests/lean/run/float_cases_bug.lean
Leonardo de Moura 607d22ae58 fix(library/compiler/csimp): bug at float_cases_on_core
The bug occurs when floating `cases_on` application in code of the form
```
let x := C.cases_on ...
in t
```
and when the type of `t` depends on `x`.
The issue here is that the `x` declaration disappears after the float, but the resulting type still depends on it.
We fix the bug by replacing `x` with its value in the type.

cc @kha
2018-11-30 11:40:41 -08:00

2 lines
64 B
Text

def foo (xs : list nat) :=
xs.span (λ n, ↑(to_bool (n = 1)))