Skip to content

Invalid production rule? #2186

Closed
scala/scala3
#15424
@danecek

Description

@danecek
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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions