Closed
Description
trait Showable[A]:
extension (a: A) def show: String
case class Person(firstName: String, lastName: String)
//StructuralInstance ::= ConstrApp {‘with’ ConstrApp} [‘with’ TemplateBody]
//TemplateBody ::= :<<< [SelfType] TemplateStat {semi TemplateStat} >>>
given Showable[Person] with : // ################ an identifier expected, but ':' found
extension (p: Person) def show: String =
s"${p.firstName} ${p.lastName}"
Metadata
Metadata
Assignees
Labels
No labels