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
disable string interpolation warning per-expr #9930
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9930?orig=1 |
@SethTisue said: |
Moses Nakamura (mosesn) said: |
@som-snytt said: Another idea is an interpolator that does char replacement, a"x@y". Or a macro literally("x$y") that rewrites to f"x$$y". Any sort of filter for reporting would require syntax. An annotation might work for syntax, but also require more work like the dotty reporting initiative. |
Moses Nakamura (mosesn) said: |
@som-snytt said: |
Moses Nakamura (mosesn) said: |
@SethTisue said: |
@som-snytt said: So, I suggested lit"x$$y" to mean "x$y" and in particular for the mistaken lit"x$$y$z" to error, because lit"x$$y$$z" was intended. It's just a way to cope with expressing constant strings with dollars, while still warning about "x$y". I noticed that "interpolation" has the anagram "Operation: Lint". |
There's no way to tell the compiler, "No, I really do want a dollar sign in this string" without turning off the warning for the rest of the strings. This leads to weird hacks like string interpolating a string which you normally wouldn't have string interpolated in order to get rid of the warning.
The text was updated successfully, but these errors were encountered: