lean4-htt/tests/lean/run/inlineProjInstIssue.lean

15 lines
345 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.

class NameableType (τ : Type) where
name : String
instance : NameableType String where
name := "String"
instance [inst : NameableType α] : NameableType (Array α) where
name :=
if inst.name.contains ' ' then
s!"Array ({inst.name})"
else
s!"Array {inst.name}"
def foo : String :=
NameableType.name (Array String)