forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nonunit-if.check
57 lines (57 loc) · 2.72 KB
/
nonunit-if.check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
nonunit-if.scala:58: warning: discarded non-Unit value of type U
if (!isEmpty) f(a) // warn, check is on
^
nonunit-if.scala:62: warning: discarded non-Unit value of type Boolean
f(a) // warn, check is on
^
nonunit-if.scala:13: warning: unused value of type scala.concurrent.Future[Int] (add `: Unit` to discard silently)
improved // warn
^
nonunit-if.scala:20: warning: unused value of type String (add `: Unit` to discard silently)
new E().toString // warn
^
nonunit-if.scala:26: warning: unused value of type scala.concurrent.Future[Int] (add `: Unit` to discard silently)
Future(42) // warn
^
nonunit-if.scala:30: warning: unused value of type K (add `: Unit` to discard silently)
copy() // warn
^
nonunit-if.scala:37: warning: unused value of type List[Int] (add `: Unit` to discard silently)
27 +: xs // warn
^
nonunit-if.scala:44: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses
null // warn for purity
^
nonunit-if.scala:58: warning: unused value of type U (add `: Unit` to discard silently)
if (!isEmpty) f(a) // warn, check is on
^
nonunit-if.scala:62: warning: unused value of type Boolean (add `: Unit` to discard silently)
f(a) // warn, check is on
^
nonunit-if.scala:73: warning: unused value of type U (add `: Unit` to discard silently)
if (!fellback) action(z) // warn, check is on
^
nonunit-if.scala:81: warning: unused value of type Int (add `: Unit` to discard silently)
g // warn, check is on
^
nonunit-if.scala:79: warning: unused value of type Int (add `: Unit` to discard silently)
g // warn block statement
^
nonunit-if.scala:86: warning: unused value of type Int (add `: Unit` to discard silently)
g // warn
^
nonunit-if.scala:84: warning: unused value of type Int (add `: Unit` to discard silently)
g // warn
^
nonunit-if.scala:96: warning: unused value of type Int (add `: Unit` to discard silently)
if (b) { // warn, at least one branch looks interesting
^
nonunit-if.scala:116: warning: unused value of type scala.collection.mutable.LinkedHashSet[A] (add `: Unit` to discard silently)
set += a // warn because cannot know whether the `set` was supposed to be consumed or assigned
^
nonunit-if.scala:146: warning: unused value of type String (add `: Unit` to discard silently)
while (it.hasNext) it.next() // warn
^
error: No warnings can be incurred under -Werror.
18 warnings
1 error