forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scala#9032 from som-snytt/issue/12026
All filters must match for nowarn
- Loading branch information
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
t12026.scala:11: warning: discarded non-Unit value | ||
def f(): Unit = v() | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
1 warning | ||
1 error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//scalac: -Wvalue-discard -Werror | ||
|
||
import annotation._ | ||
|
||
//the following option works and warns for f but not g | ||
//-Wconf:cat=w-flag-value-discard&site=T.g:s | ||
|
||
@nowarn("cat=w-flag-value-discard&site=T.g") | ||
trait T { | ||
def v(): Int | ||
def f(): Unit = v() | ||
def g(): Unit = v() | ||
} | ||
// was: no warning |