lean4-htt/tests/lean/implementedByIssue.lean

19 lines
574 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 [implementedBy get] Array.data -- ok
def get_2 {α : Type} {n : Nat} (A : Array α n) (i : Fin n) : α := A.data i
attribute [implementedBy 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 [implementedBy get_3] Array.data -- error, types do not match