Fixes issue reported at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/LCNF.20local.20context.20contains.20unused.20local.20variable.20declaratio/near/301102923
15 lines
345 B
Text
15 lines
345 B
Text
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)
|