Skip to content

Invalid production rule? #2186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
danecek opened this issue Sep 21, 2021 · 2 comments · Fixed by scala/scala3#15424
Closed

Invalid production rule? #2186

danecek opened this issue Sep 21, 2021 · 2 comments · Fixed by scala/scala3#15424

Comments

@danecek
Copy link
Contributor

danecek commented Sep 21, 2021

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}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants