lean4-htt/tests/lean/run/compiler_erase_bug.lean
Gabriel Ebner e605c541d0 fix: do not infer type in erase_irrelevant
At the time erase_irrelevant is called, we have already eliminated the
`cast`-applications.  Therefore non-atomic expressions may no longer
be well-typed (and `infer_type` can fail).
2022-01-03 07:13:55 -08:00

4 lines
151 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

def f (h : α = { n : Nat // True }) (a : α) : Nat :=
(cast h a).casesOn (motive := fun _ => Nat) fun val prop => val
#eval f rfl ⟨42, ⟨⟩⟩