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

Adding s interpolator makes String literal parsing fail #10165

Closed
scabug opened this issue Jan 25, 2017 · 2 comments
Closed

Adding s interpolator makes String literal parsing fail #10165

scabug opened this issue Jan 25, 2017 · 2 comments

Comments

@scabug
Copy link

scabug commented Jan 25, 2017

  • Start with a valid string literal which compiles.
  • Prefix with s
  • The compilation then fails
scala> val N = "00"
N: String = 00

scala> "\"N\" : \"$N\""
res1: String = "N" : "$N"

scala> s"\"N\" : \"$N\""
<console>:1: error: ';' expected but string literal found.
s"\"N\" : \"$N\""
      ^
@scabug
Copy link
Author

scabug commented Jan 25, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10165?orig=1
Reporter: @janekdb
Affected Versions: 2.11.8
Duplicates #6476

@scabug
Copy link
Author

scabug commented Jan 25, 2017

@janekdb said:
Using triple quotes is a workaround. I would rather use " as IntelliJ is overly helpful when autocompleting triple quotes plus it harder to scan """" than "\".

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

No branches or pull requests

1 participant