File tree 5 files changed +5
-17
lines changed
compiler/src/dotty/tools/dotc/typer
5 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -3102,7 +3102,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3102
3102
case ex : CyclicReference
3103
3103
if ctx.reporter.errorsReported
3104
3104
&& xtree.span.isZeroExtent
3105
- && ex.isVal && false =>
3105
+ && ex.isVal =>
3106
3106
// Don't report a "recursive val ... needs type" if errors were reported
3107
3107
// previously and the span of the offending tree is empty. In this case,
3108
3108
// it's most likely that this is desugared code, and the error message would
Original file line number Diff line number Diff line change 17
17
|
18
18
| longer explanation available when compiling with `-explain`
19
19
-- [E127] Pattern Match Error: tests/neg/i18684.scala:12:6 -------------------------------------------------------------
20
- 12 | val inner(x) = 3 // error // error
20
+ 12 | val inner(x) = 3 // error
21
21
| ^^^^^
22
22
| Test.inner cannot be used as an extractor in a pattern because it lacks an unapply or unapplySeq method
23
23
|
24
24
| longer explanation available when compiling with `-explain`
25
- -- [E045] Cyclic Error: tests/neg/i18684.scala:12:14 -------------------------------------------------------------------
26
- 12 | val inner(x) = 3 // error // error
27
- | ^
28
- | Recursive value x needs type
29
- |
30
- | longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change @@ -9,4 +9,4 @@ object Test:
9
9
object inner :
10
10
val foo() = " 33" // error
11
11
12
- val inner(x) = 3 // error // error
12
+ val inner(x) = 3 // error
Original file line number Diff line number Diff line change 27
27
|
28
28
| longer explanation available when compiling with `-explain`
29
29
-- [E032] Syntax Error: tests/neg/t5702-neg-bad-and-wild.scala:23:17 ---------------------------------------------------
30
- 23 | val K(ns @ _*, xx) = k // error: pattern expected // error
30
+ 23 | val K(ns @ _*, xx) = k // error: pattern expected
31
31
| ^
32
32
| pattern expected
33
33
|
50
50
| no pattern match extractor named * was found
51
51
|
52
52
| longer explanation available when compiling with `-explain`
53
- -- [E045] Cyclic Error: tests/neg/t5702-neg-bad-and-wild.scala:23:19 ---------------------------------------------------
54
- 23 | val K(ns @ _*, xx) = k // error: pattern expected // error
55
- | ^
56
- | Recursive value $1$ needs type
57
- |
58
- | longer explanation available when compiling with `-explain`
59
53
-- Warning: tests/neg/t5702-neg-bad-and-wild.scala:13:22 ---------------------------------------------------------------
60
54
13 | case List(1, _*3:) => // error // error
61
55
| ^
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ object Test {
20
20
// good syntax, bad semantics, detected by typer
21
21
// gowild.scala:14: error: star patterns must correspond with varargs parameters
22
22
val K (x @ _* ) = k
23
- val K (ns @ _* , xx) = k // error: pattern expected // error
23
+ val K (ns @ _* , xx) = k // error: pattern expected
24
24
val K (x) = k // error: x is already defined as value x
25
25
val (b, _ * ) = (5 ,6 ) // ok
26
26
// no longer complains
You can’t perform that action at this time.
0 commit comments