forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnowarn.check
110 lines (110 loc) · 6.85 KB
/
nowarn.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
-- [E002] Syntax Warning: tests/neg/nowarn.scala:11:10 -----------------------------------------------------------------
11 |def t1a = try 1 // warning (parser)
| ^^^^^
| A try without catch or finally is equivalent to putting
| its body in a block; no exceptions are handled.
|
| longer explanation available when compiling with `-explain`
-- [E002] Syntax Warning: tests/neg/nowarn.scala:25:25 -----------------------------------------------------------------
25 |@nowarn(o.inl) def t2d = try 1 // two warnings (`inl` is not a compile-time constant)
| ^^^^^
| A try without catch or finally is equivalent to putting
| its body in a block; no exceptions are handled.
|
| longer explanation available when compiling with `-explain`
-- [E002] Syntax Warning: tests/neg/nowarn.scala:33:26 -----------------------------------------------------------------
33 |@nowarn("id=1") def t4d = try 1 // error and warning (unused nowarn, wrong id)
| ^^^^^
| A try without catch or finally is equivalent to putting
| its body in a block; no exceptions are handled.
|
| longer explanation available when compiling with `-explain`
-- [E002] Syntax Warning: tests/neg/nowarn.scala:35:28 -----------------------------------------------------------------
35 |@nowarn("verbose") def t5 = try 1 // warning with details
| ^^^^^
| A try without catch or finally is equivalent to putting
| its body in a block; no exceptions are handled.
|Matching filters for @nowarn or -Wconf:
| - id=E2
| - name=EmptyCatchAndFinallyBlock
|
| longer explanation available when compiling with `-explain`
-- [E129] Potential Issue Warning: tests/neg/nowarn.scala:15:11 --------------------------------------------------------
15 |def t2 = { 1; 2 } // warning (the invalid nowarn doesn't silence anything)
| ^
| A pure expression does nothing in statement position
|
| longer explanation available when compiling with `-explain`
-- Warning: tests/neg/nowarn.scala:14:8 --------------------------------------------------------------------------------
14 |@nowarn("wat?") // warning (typer, invalid filter)
| ^^^^^^
| Invalid message filter
| unknown filter: wat?
-- [E129] Potential Issue Warning: tests/neg/nowarn.scala:18:12 --------------------------------------------------------
18 |def t2a = { 1; 2 } // warning (invalid nowarn doesn't silence)
| ^
| A pure expression does nothing in statement position
|
| longer explanation available when compiling with `-explain`
-- Warning: tests/neg/nowarn.scala:17:8 --------------------------------------------------------------------------------
17 |@nowarn(t1a.toString) // warning (typer, argument not a compile-time constant)
| ^^^^^^^^^^^^
| filter needs to be a compile-time constant string
-- Warning: tests/neg/nowarn.scala:25:10 -------------------------------------------------------------------------------
25 |@nowarn(o.inl) def t2d = try 1 // two warnings (`inl` is not a compile-time constant)
| ^^^^^
| filter needs to be a compile-time constant string
-- Deprecation Warning: tests/neg/nowarn.scala:39:10 -------------------------------------------------------------------
39 |def t6a = f // warning (refchecks, deprecation)
| ^
| method f is deprecated
-- Deprecation Warning: tests/neg/nowarn.scala:42:30 -------------------------------------------------------------------
42 |@nowarn("msg=fish") def t6d = f // error (unused nowarn), warning (deprecation)
| ^
| method f is deprecated
-- Deprecation Warning: tests/neg/nowarn.scala:49:10 -------------------------------------------------------------------
49 |def t7c = f // warning (deprecation)
| ^
| method f is deprecated
-- [E092] Pattern Match Unchecked Warning: tests/neg/nowarn.scala:55:7 -------------------------------------------------
55 | case _: List[Int] => 0 // warning (patmat, unchecked)
| ^
|the type test for List[Int] cannot be checked at runtime because its type arguments can't be determined from Any
|
| longer explanation available when compiling with `-explain`
-- Error: tests/neg/nowarn.scala:33:1 ----------------------------------------------------------------------------------
33 |@nowarn("id=1") def t4d = try 1 // error and warning (unused nowarn, wrong id)
|^^^^^^^^^^^^^^^
|@nowarn annotation does not suppress any warnings
-- Error: tests/neg/nowarn.scala:42:1 ----------------------------------------------------------------------------------
42 |@nowarn("msg=fish") def t6d = f // error (unused nowarn), warning (deprecation)
|^^^^^^^^^^^^^^^^^^^
|@nowarn annotation does not suppress any warnings
-- Error: tests/neg/nowarn.scala:50:5 ----------------------------------------------------------------------------------
50 | : @nowarn("msg=fish") // error (unused nowarn)
| ^^^^^^^^^^^^^^^^^^^
| @nowarn annotation does not suppress any warnings
-- Error: tests/neg/nowarn.scala:62:0 ----------------------------------------------------------------------------------
62 |@nowarn def t9a = { 1: @nowarn; 2 } // error (outer @nowarn is unused)
|^^^^^^^
|@nowarn annotation does not suppress any warnings
-- Error: tests/neg/nowarn.scala:63:27 ---------------------------------------------------------------------------------
63 |@nowarn def t9b = { 1: Int @nowarn; 2 } // error (inner @nowarn is unused, it covers the type, not the expression)
| ^^^^^^^
| @nowarn annotation does not suppress any warnings
-- Error: tests/neg/nowarn.scala:68:0 ----------------------------------------------------------------------------------
68 |@nowarn @ann(f) def t10b = 0 // error (unused nowarn)
|^^^^^^^
|@nowarn annotation does not suppress any warnings
-- Error: tests/neg/nowarn.scala:69:8 ----------------------------------------------------------------------------------
69 |@ann(f: @nowarn) def t10c = 0 // error (unused nowarn), should be silent
| ^^^^^^^
| @nowarn annotation does not suppress any warnings
-- Error: tests/neg/nowarn.scala:72:0 ----------------------------------------------------------------------------------
72 |@nowarn class I1a { // error (unused nowarn)
|^^^^^^^
|@nowarn annotation does not suppress any warnings
-- Error: tests/neg/nowarn.scala:77:0 ----------------------------------------------------------------------------------
77 |@nowarn class I1b { // error (unused nowarn)
|^^^^^^^
|@nowarn annotation does not suppress any warnings