File tree 7 files changed +7
-19
lines changed
compiler/src/dotty/tools/dotc/typer
7 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -3176,7 +3176,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3176
3176
case ex : CyclicReference
3177
3177
if ctx.reporter.errorsReported
3178
3178
&& xtree.span.isZeroExtent
3179
- && ex.isVal && false =>
3179
+ && ex.isVal =>
3180
3180
// Don't report a "recursive val ... needs type" if errors were reported
3181
3181
// previously and the span of the offending tree is empty. In this case,
3182
3182
// it's most likely that this is desugared code, and the error message would
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import scala.quoted.*
5
5
inline def mcr (x : => Any ): Any = $ {mcrImpl(' x )}
6
6
7
7
def mcrImpl (body : Expr [Any ])(using ctx : Quotes ): Expr [Any ] = {
8
- val ' {$x : $t} = body // error // error
8
+ val ' {$x : $t} = body // error
9
9
' {
10
10
val tmp : $t = $x.asInstanceOf [$t] // error // error
11
11
println(tmp)
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def foo1: Unit =
24
24
// then Typer rejects "String" as an infix extractor (like ::)
25
25
// which is the second error
26
26
27
- def foo2 : Unit = // error
27
+ def foo2 : Unit = // was: error, recursive value _root_ needs type
28
28
val _root_ : String = " abc" // error
29
29
30
30
// i17757
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 31
31
|
32
32
| longer explanation available when compiling with `-explain`
33
33
-- [E032] Syntax Error: tests/neg/t5702-neg-bad-and-wild.scala:23:17 ---------------------------------------------------
34
- 23 | val K(ns @ _*, xx) = k // error: pattern expected // error
34
+ 23 | val K(ns @ _*, xx) = k // error: pattern expected
35
35
| ^
36
36
| pattern expected
37
37
|
58
58
| no pattern match extractor named * was found
59
59
|
60
60
| longer explanation available when compiling with `-explain`
61
- -- [E045] Cyclic Error: tests/neg/t5702-neg-bad-and-wild.scala:23:19 ---------------------------------------------------
62
- 23 | val K(ns @ _*, xx) = k // error: pattern expected // error
63
- | ^
64
- | Recursive value $1$ needs type
65
- |
66
- | longer explanation available when compiling with `-explain`
67
61
-- Warning: tests/neg/t5702-neg-bad-and-wild.scala:13:22 ---------------------------------------------------------------
68
62
13 | case List(1, _*3:) => // error // error
69
63
| ^
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 ) // error: bad use of `*`
26
26
// no longer complains
You can’t perform that action at this time.
0 commit comments