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

f interpolator doesn't process backslash escapes #11750

Closed
lrytz opened this issue Mar 15, 2021 · 8 comments · Fixed by #13367
Closed

f interpolator doesn't process backslash escapes #11750

lrytz opened this issue Mar 15, 2021 · 8 comments · Fixed by #13367

Comments

@lrytz
Copy link
Member

lrytz commented Mar 15, 2021

Scala 2:

scala> f"yes\\\no"
val res0: String =
yes\
o

Scala 3:

scala> f"yes\\\no"
val res0: String = yes\\\no
@odersky
Copy link
Contributor

odersky commented Mar 15, 2021

I don't think it's the parser. Interpolated strings do not process "\" escapes. That's for the interpolator to do. Or did I get that wrong?

@lrytz
Copy link
Member Author

lrytz commented Mar 15, 2021

yes, the interpolator should handle the escapes. i haven't checked why it doesn't do so in dotty

@odersky
Copy link
Contributor

odersky commented Mar 16, 2021

Why is this a "transform" issue? Isn't the F-interpolator a macro?

@abgruszecki
Copy link
Contributor

Assigning Nico, since his student worked on the interpolator.

@abgruszecki abgruszecki added area:library Standard library and removed area:transform labels Mar 16, 2021
@som-snytt
Copy link
Contributor

By coincidence, my dotty repo is on the branch for #9939 where I've only collected examples of divergent behavior. Every 6 months or so, I intend to take a look.

@smarter
Copy link
Member

smarter commented Mar 16, 2021

@smarter smarter added area:transform and removed area:library Standard library labels Mar 16, 2021
@nicolasstucki
Copy link
Contributor

We still want to port the Scala 2 implementation of the f interpolation checker. We should probably not fix this one and just port it, which should fix the issue.

@nicolasstucki
Copy link
Contributor

Same solution as in #9939 (comment)

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

Successfully merging a pull request may close this issue.

7 participants