lean4-htt/tests/lean/implementedByIssue.lean
2022-10-19 09:28:08 -07:00

19 lines
577 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 Hidden
structure Array (α : Type u) (n : Nat) : Type u where
data : (i : Fin n) → α
@[extern "some_extern"]
def get {α} {n : Nat}
(A : Array α n) (i : Fin n) : α
:= A.data i
attribute [implemented_by get] Array.data -- ok
def get_2 {α : Type} {n : Nat} (A : Array α n) (i : Fin n) : α := A.data i
attribute [implemented_by get_2] Array.data -- error, number of universe parameters do not match
def get_3 {α} {n : Nat} (i : Fin n) (A : Array α n) : α := A.data i
attribute [implemented_by get_3] Array.data -- error, types do not match