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
false positive in possible string interpolation warning #8476
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8476?orig=1 |
Jed Wesley-Smith (jedws) said: Is there a macro that performs no interpolation and avoids this warning? |
Jed Wesley-Smith (jedws) said: I wrote code (in fact, I didn't I wrote a String literal) and the compiler helpfully warns me that it looks like I might have meant it to be code after all, except I didn't, if I had I would have put a macro in front of it. This is like warning if I use the Int constant 43 that perhaps 42 is a nicer number! It makes -Xlint far less useful for us currently (we can only turn it on if we workaround the original problem, for instance by externalising the Strings in question, which is sub-optimal. |
@retronym said (edited on Apr 23, 2014 5:30:04 AM UTC): There is a tension between adding a -Yoption for each warning (maximum flexibility) vs lumping many warnings under In the meantime, you can do this yourself in SBT. I remember I helped @puffnfresh configure this a month or so ago. I'll try to dig up the example. |
Jed Wesley-Smith (jedws) said: And, my objection to this specific warning as a valid thing stands. |
@retronym said (edited on Apr 23, 2014 5:43:53 AM UTC): """ @{foo} """.replaceAllLiterally("@", "$"). |
Closing because the example doesn't warn, for some time now, unless the ident is in scope. Also, a filtering reporter is on the horizon for the worst case scenario. Also, the warning can be disabled. |
In the following case no warning should be shown:
The text was updated successfully, but these errors were encountered: