lean4-htt/tests/lean/run/coeOutParamIssue.lean
2022-07-06 16:55:08 -07:00

22 lines
447 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.

namespace Ex
class Get (Cont : Type u) (Idx : Type v) (Elem : outParam (Type w)) where
get (xs : Cont) (i : Idx) : Elem
export Get (get)
instance [Inhabited α] : Get (Array α) Nat α where
get xs i := xs.get! i
instance : Coe Bool Nat where
coe b := if b then 1 else 0
def g (as : Array (Array Bool)) : Nat :=
let bs := get as 0
get bs 0
def h (as : Array (Array Bool)) (i : Nat) : Nat :=
let bs := get as i
get bs i
end Ex