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).
4 lines
151 B
Text
4 lines
151 B
Text
def f (h : α = { n : Nat // True }) (a : α) : Nat :=
|
||
(cast h a).casesOn (motive := fun _ => Nat) fun val prop => val
|
||
|
||
#eval f rfl ⟨42, ⟨⟩⟩
|