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

String interpolation parsing in initializers regression in 3.2.0 #16043

Closed
jrudolph opened this issue Sep 15, 2022 · 2 comments
Closed

String interpolation parsing in initializers regression in 3.2.0 #16043

jrudolph opened this issue Sep 15, 2022 · 2 comments
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label

Comments

@jrudolph
Copy link
Contributor

Compiler version

3.2.0

Minimized code

val str = "test"
class Test { s"$str" }

Output

-- Error: ----------------------------------------------------------------------
2 |class Test { s"$str" }
  |                   ^
  |                   unclosed string literal

Expectation

Compiles as in 3.1.x.

This seems to be a particular issue about initializers. Here are a few instances that work:

{ val str = "test"; s"$str" }
class Test(str: String) { def test = s"$str" }
{ val str = "test"; trait Test { s"${str}" } }
@jrudolph jrudolph added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Sep 15, 2022
@jrudolph
Copy link
Contributor Author

Seems to be fixed in 3.2.1-RC1 so just filing for reference. Maybe same/similar cause as #15514?

@jrudolph jrudolph closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2022
@som-snytt
Copy link
Contributor

Yes, that is the same issue. The shared element is the string interpolation in "self-type" position of a template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label
Projects
None yet
Development

No branches or pull requests

3 participants