forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathi18722.check
44 lines (44 loc) · 3.44 KB
/
i18722.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
-- [E190] Potential Issue Warning: tests/warn/i18722.scala:3:15 --------------------------------------------------------
3 |def f1: Unit = null // warn
| ^^^^
| Discarded non-Unit value of type Null. Add `: Unit` to discard silently.
|---------------------------------------------------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| As this expression is not of type Unit, it is desugared into `{ null; () }`.
| Here the `null` expression is a pure statement that can be discarded.
| Therefore the expression is effectively equivalent to `()`.
---------------------------------------------------------------------------------------------------------------------
-- [E190] Potential Issue Warning: tests/warn/i18722.scala:4:15 --------------------------------------------------------
4 |def f2: Unit = 1 // warn
| ^
| Discarded non-Unit value of type Int. Add `: Unit` to discard silently.
|---------------------------------------------------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| As this expression is not of type Unit, it is desugared into `{ 1; () }`.
| Here the `1` expression is a pure statement that can be discarded.
| Therefore the expression is effectively equivalent to `()`.
---------------------------------------------------------------------------------------------------------------------
-- [E190] Potential Issue Warning: tests/warn/i18722.scala:5:15 --------------------------------------------------------
5 |def f3: Unit = "a" // warn
| ^^^
| Discarded non-Unit value of type String. Add `: Unit` to discard silently.
|---------------------------------------------------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| As this expression is not of type Unit, it is desugared into `{ "a"; () }`.
| Here the `"a"` expression is a pure statement that can be discarded.
| Therefore the expression is effectively equivalent to `()`.
---------------------------------------------------------------------------------------------------------------------
-- [E190] Potential Issue Warning: tests/warn/i18722.scala:7:15 --------------------------------------------------------
7 |def f4: Unit = i // warn
| ^
| Discarded non-Unit value of type Int. Add `: Unit` to discard silently.
|---------------------------------------------------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| As this expression is not of type Unit, it is desugared into `{ i; () }`.
| Here the `i` expression is a pure statement that can be discarded.
| Therefore the expression is effectively equivalent to `()`.
---------------------------------------------------------------------------------------------------------------------