Skip to content
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

can't use string interpolator with unicode characters from categories Ll, Lu, Lt, Nl #12486

Closed
unkarjedy opened this issue Nov 6, 2021 · 0 comments · Fixed by scala/scala#9805
Assignees
Labels
Milestone

Comments

@unkarjedy
Copy link

Scala 2.13.7

From https://www.scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html:

interpolatedString ::=  alphaid ...
alphaid          ::=  upper idrest
                   |  varid // lower idrest
upper            ::=  ... any character in Unicode categories Lu, Lt or Nl,
                      and any character in Unicode categories Lo and Lm that don't have
                      contributory property Other_Lowercase
lower            ::=  ‘a’ | … | ‘z’ | ‘_’ and any character in Unicode category Ll,
                      and any character in Unicode categories Lo or Lm that has contributory
                      property Other_Lowercase
object O2 {
  //OK
  a"${1}"

  // false compiler error: ';' expected but string literal found
  𝓅"${1}"
  𐐀"${1}"
  Dž"${1}""${1}"

  implicit class MyInterpolators(sc: StringContext) {
    def a(subs: Any*): String = ???
    def 𝓅(subs: Any*): String = ??? // category: Ll
    def 𐐀(subs: Any*): String = ??? // category: Lu
    def Dž(subs: Any*): String = ??? // category: Lt
    def (subs: Any*): String = ??? // category: Nl
  }
}

JFR All identifiers are accepted by the Java compiler

class MyJava {
    public void 𝓅() {}
    public void 𐐀() {}
    public void Dž() {}
    public void ᛮ() {}
}

relates to:
#1406
scala/scala#9687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants