File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
compiler/src/dotty/tools/dotc/transform
tests/neg-custom-args/fatal-warnings Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ class CheckUnused extends MiniPhase:
241
241
// ! DIFFERS FROM MINIPHASE
242
242
typeTraverser(unusedDataApply).traverse(t.tpe)
243
243
traverseChildren(tree)(using newCtx)
244
- case tree =>
244
+ case _ =>
245
245
// ! DIFFERS FROM MINIPHASE
246
246
traverseChildren(tree)(using newCtx)
247
247
end traverse
Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ class Foo {
59
59
var e1 = 1 // error not set
60
60
def e2 = e1 // OK
61
61
val e3 = e2 // OK
62
- e3
62
+ e3
63
63
64
64
val g = // OK
65
65
var e1 = 1 // OK
66
66
def e2 = e1 // OK
67
67
val e3 = e2 // OK
68
68
e1 = e3 // OK
69
- e3
69
+ e3
70
70
71
71
def d = 1 // OK
72
72
Original file line number Diff line number Diff line change @@ -12,20 +12,37 @@ class A:
12
12
private [this ] val f = e // OK
13
13
private val g = f // OK
14
14
15
+ private [A ] var h = 1 // OK
16
+ private [this ] var i = h // error not set
17
+ private var j = i // error not set
18
+
19
+ private [this ] var k = 1 // OK
20
+ private var l = 2 // OK
21
+ private val m = // error
22
+ k = l
23
+ l = k
24
+ l
25
+
15
26
private def fac (x : Int ): Int = // error
16
27
if x == 0 then 1 else x * fac(x - 1 )
17
28
18
29
val x = 1 // OK
19
30
def y = 2 // OK
20
31
def z = g // OK
32
+ var w = 2 // OK
21
33
22
34
package foo .test .contructors:
23
35
case class A private (x: Int ) // OK
24
36
class B private (val x : Int ) // OK
25
37
class C private (private val x : Int ) // error
26
38
class D private (private val x : Int ): // OK
27
39
def y = x
28
-
40
+ class E private (private var x : Int ): // error not set
41
+ def y = x
42
+ class F private (private var x : Int ): // OK
43
+ def y =
44
+ x = 3
45
+ x
29
46
30
47
package test .foo .i16682:
31
48
object myPackage :
You can’t perform that action at this time.
0 commit comments