Skip to content

f interpolator rejects vertical bar followed by newline following interpolation %s|%n #13098

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
cayhorstmann opened this issue Jul 18, 2021 · 2 comments

Comments

@cayhorstmann
Copy link

Compiler version

3.0.0

Minimized code

val s = "Fred"
f"$s|%n"

Output

conversions must follow a splice; use %% for literal %, %n for newline. 

Expectation

"Fred|" followed by a newline

@som-snytt
Copy link
Contributor

Thanks for the report. That is #9939 (comment) where %n consumes the preceding interpolation.

The VBAR is not special here. Without it, %n would swallow Fred.

I did some work on that PR, and will return to it shortly.

@smarter
Copy link
Member

smarter commented Jul 19, 2021

Closing as duplicate of #9939 then

@smarter smarter closed this as completed Jul 19, 2021
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

3 participants