-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Show nowarn / Wconf filters for a warning with @nowarn("verbose") #10985
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
Conversation
That is so cool! TIL! and I just made a tweak on dotty about nowarn and didn't notice. Not that I didn't believe you, but I had to try it out on my test file.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize innovations were propagating in this direction.
It's very nice when similarity of code makes porting and reviews easier or possible.
Every code base should have That doesn't work yet. |
Changing compiler flags is much more tedious than adding an annotation to the source and rebuilding. Scala 3 For Scala 2, I looked through the settings. Scoped So maybe |
As already implemented in Scala 3 ``` scala> @nowarn("v") def f = try 1 ^ warning: A try without a catch or finally is equivalent to putting its body in a block; no exceptions are handled. Applicable -Wconf / @nowarn filters for this warning: msg=<part of the message>, cat=other, site=f def f: Int ```
flags vs annotations is sad but true. Also counter-intuitive from an old school perspective. Modifying source is heavyweight, but because of the "build tool", flipping an option is heavier. I don't use an IDE, although previously I used Eclipse for Java projects, but I can see the "local" use case: there is some weirdness in my code, it shows a red squiggle or perhaps amber, I want to click an icon to show what I can do to silence the squiggle. That workflow is entirely local. The missing piece is still an audit to tell me what warnings were modified (locally suppressed) in my code. |
Show nowarn / Wconf filters for a warning with @nowarn("verbose")
Show nowarn / Wconf filters for a warning with @nowarn("verbose")
As already implemented in Scala 3
(https://hachyderm.io/@spills/112831541923471812)