|
| 1 | +-- [E176] Potential Issue Warning: tests/warn/nonunit-statement.scala:13:4 --------------------------------------------- |
| 2 | +13 | improved // warn |
| 3 | + | ^^^^^^^^ |
| 4 | + | unused value of type (improved : => scala.concurrent.Future[Int]) |
| 5 | +-- [E176] Potential Issue Warning: tests/warn/nonunit-statement.scala:20:4 --------------------------------------------- |
| 6 | +20 | new E().toString // warn |
| 7 | + | ^^^^^^^^^^^^^^^^ |
| 8 | + | unused value of type String |
| 9 | +-- [E176] Potential Issue Warning: tests/warn/nonunit-statement.scala:26:2 --------------------------------------------- |
| 10 | +26 | Future(42) // warn |
| 11 | + | ^^^^^^^^^^ |
| 12 | + | unused value of type scala.concurrent.Future[Int] |
| 13 | +-- [E176] Potential Issue Warning: tests/warn/nonunit-statement.scala:30:6 --------------------------------------------- |
| 14 | +30 | copy() // warn |
| 15 | + | ^^^^^^ |
| 16 | + | unused value of type K |
| 17 | +-- [E176] Potential Issue Warning: tests/warn/nonunit-statement.scala:37:2 --------------------------------------------- |
| 18 | +37 | 27 +: xs // warn |
| 19 | + | ^^^^^^^^ |
| 20 | + | unused value of type List[Int] |
| 21 | +-- [E129] Potential Issue Warning: tests/warn/nonunit-statement.scala:44:2 --------------------------------------------- |
| 22 | +44 | null // warn for purity |
| 23 | + | ^^^^ |
| 24 | + | A pure expression does nothing in statement position |
| 25 | + | |
| 26 | + | longer explanation available when compiling with `-explain` |
| 27 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:58:19 -------------------------------------------- |
| 28 | +58 | if (!isEmpty) f(a) // warn (if) |
| 29 | + | ^^^^ |
| 30 | + | discarded non-Unit value of type U |
| 31 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:62:7 --------------------------------------------- |
| 32 | +62 | f(a) // warn (if) |
| 33 | + | ^^^^ |
| 34 | + | discarded non-Unit value of type Boolean |
| 35 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:73:25 -------------------------------------------- |
| 36 | +73 | if (!fellback) action(z) // warn (if) |
| 37 | + | ^^^^^^^^^ |
| 38 | + | discarded non-Unit value of type U |
| 39 | +-- [E176] Potential Issue Warning: tests/warn/nonunit-statement.scala:79:6 --------------------------------------------- |
| 40 | +79 | g // warn block statement |
| 41 | + | ^ |
| 42 | + | unused value of type (g : => Int) |
| 43 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:81:6 --------------------------------------------- |
| 44 | +81 | g // warn (if) |
| 45 | + | ^ |
| 46 | + | discarded non-Unit value of type (g : => Int) |
| 47 | +-- [E176] Potential Issue Warning: tests/warn/nonunit-statement.scala:84:6 --------------------------------------------- |
| 48 | +84 | g // warn |
| 49 | + | ^ |
| 50 | + | unused value of type (g : => Int) |
| 51 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:86:6 --------------------------------------------- |
| 52 | +86 | g // warn |
| 53 | + | ^ |
| 54 | + | discarded non-Unit value of type (g : => Int) |
| 55 | +-- [E176] Potential Issue Warning: tests/warn/nonunit-statement.scala:96:4 --------------------------------------------- |
| 56 | + 96 | if (b) { // warn, at least one branch looks interesting |
| 57 | + | ^ |
| 58 | + | unused value of type Int |
| 59 | + 97 | println("true") |
| 60 | + 98 | i |
| 61 | + 99 | } |
| 62 | +100 | else { |
| 63 | +101 | println("false") |
| 64 | +102 | j |
| 65 | +103 | } |
| 66 | +-- [E176] Potential Issue Warning: tests/warn/nonunit-statement.scala:116:4 -------------------------------------------- |
| 67 | +116 | set += a // warn because cannot know whether the `set` was supposed to be consumed or assigned |
| 68 | + | ^^^^^^^^ |
| 69 | + | unused value of type scala.collection.mutable.LinkedHashSet[A] |
| 70 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:126:37 ------------------------------------------- |
| 71 | +126 | if (start.length != 0) jsb.append(start) // warn (value-discard) |
| 72 | + | ^^^^^^^^^^^^^^^^^ |
| 73 | + | discarded non-Unit value of type StringBuilder |
| 74 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:132:18 ------------------------------------------- |
| 75 | +132 | jsb.append(it.next()) // warn (value-discard) |
| 76 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 77 | + | discarded non-Unit value of type StringBuilder |
| 78 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:135:35 ------------------------------------------- |
| 79 | +135 | if (end.length != 0) jsb.append(end) // warn (value-discard) |
| 80 | + | ^^^^^^^^^^^^^^^ |
| 81 | + | discarded non-Unit value of type StringBuilder |
| 82 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:141:14 ------------------------------------------- |
| 83 | +141 | b.append(it.next()) // warn (value-discard) |
| 84 | + | ^^^^^^^^^^^^^^^^^^^ |
| 85 | + | discarded non-Unit value of type StringBuilder |
| 86 | +-- [E175] Potential Issue Warning: tests/warn/nonunit-statement.scala:146:30 ------------------------------------------- |
| 87 | +146 | while (it.hasNext) it.next() // warn |
| 88 | + | ^^^^^^^^^ |
| 89 | + | discarded non-Unit value of type String |
0 commit comments