diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index be8e56bf0ef3..6c78bf8a98dc 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -214,7 +214,7 @@ class CompilationTests { implicit val testGroup: TestGroup = TestGroup("checkInitGlobal") val options = defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings") compileFilesInDir("tests/init-global/neg", options).checkExpectedErrors() - compileFilesInDir("tests/init-global/warn", options).checkWarnings() + compileFilesInDir("tests/init-global/warn", defaultOptions.and("-Ysafe-init-global")).checkWarnings() compileFilesInDir("tests/init-global/pos", options).checkCompile() } @@ -223,7 +223,7 @@ class CompilationTests { implicit val testGroup: TestGroup = TestGroup("checkInit") val options = defaultOptions.and("-Ysafe-init", "-Xfatal-warnings") compileFilesInDir("tests/init/neg", options).checkExpectedErrors() - compileFilesInDir("tests/init/warn", options).checkWarnings() + compileFilesInDir("tests/init/warn", defaultOptions.and("-Ysafe-init")).checkWarnings() compileFilesInDir("tests/init/pos", options).checkCompile() compileFilesInDir("tests/init/crash", options.without("-Xfatal-warnings")).checkCompile() // The regression test for i12128 has some atypical classpath requirements. diff --git a/tests/init-global/neg/context-sensitivity.check b/tests/init-global/neg/context-sensitivity.check index 4c7e679685a1..e5eaad3d2a58 100644 --- a/tests/init-global/neg/context-sensitivity.check +++ b/tests/init-global/neg/context-sensitivity.check @@ -1,11 +1,11 @@ -- Warning: tests/init-global/neg/context-sensitivity.scala:9:21 ------------------------------------------------------- 9 | def foo(): Int = A.m | ^^^ - | Access uninitialized field value m. Call trace: - | -> object A: [ context-sensitivity.scala:14 ] - | ^ - | -> val m: Int = box1.value.foo() [ context-sensitivity.scala:17 ] - | ^^^^^^^^^^^^^^^^ - | -> def foo(): Int = A.m [ context-sensitivity.scala:9 ] - | ^^^ + | Access uninitialized field value m. Calling trace: + | ├── object A: [ context-sensitivity.scala:14 ] + | │ ^ + | ├── val m: Int = box1.value.foo() [ context-sensitivity.scala:17 ] + | │ ^^^^^^^^^^^^^^^^ + | └── def foo(): Int = A.m [ context-sensitivity.scala:9 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-cycle14.check b/tests/init-global/neg/global-cycle14.check index 29c28fbd1bc4..d976653c05f0 100644 --- a/tests/init-global/neg/global-cycle14.check +++ b/tests/init-global/neg/global-cycle14.check @@ -2,20 +2,20 @@ 8 |object A { | ^ | Cyclic initialization: object A -> object B -> object A. Calling trace: - | -> object A { [ global-cycle14.scala:8 ] - | ^ - | -> val n: Int = B.m [ global-cycle14.scala:9 ] - | ^ - | -> object B { [ global-cycle14.scala:12 ] - | ^ - | -> val m: Int = A.n [ global-cycle14.scala:13 ] - | ^ + | ├── object A { [ global-cycle14.scala:8 ] + | │ ^ + | ├── val n: Int = B.m [ global-cycle14.scala:9 ] + | │ ^ + | ├── object B { [ global-cycle14.scala:12 ] + | │ ^ + | └── val m: Int = A.n [ global-cycle14.scala:13 ] + | ^ -- Warning: tests/init-global/neg/global-cycle14.scala:13:17 ----------------------------------------------------------- 13 | val m: Int = A.n | ^^^ - | Access uninitialized field value n. Call trace: - | -> object B { [ global-cycle14.scala:12 ] - | ^ - | -> val m: Int = A.n [ global-cycle14.scala:13 ] - | ^^^ + | Access uninitialized field value n. Calling trace: + | ├── object B { [ global-cycle14.scala:12 ] + | │ ^ + | └── val m: Int = A.n [ global-cycle14.scala:13 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-cycle2.check b/tests/init-global/neg/global-cycle2.check index 96bedda57cb5..e01fb2f15aea 100644 --- a/tests/init-global/neg/global-cycle2.check +++ b/tests/init-global/neg/global-cycle2.check @@ -1,11 +1,11 @@ -- Warning: tests/init-global/neg/global-cycle2.scala:6:21 ------------------------------------------------------------- 6 | def foo(): Int = A.a * 2 | ^^^ - | Access uninitialized field value a. Call trace: - | -> object A { [ global-cycle2.scala:1 ] - | ^ - | -> val a: Int = B.foo() [ global-cycle2.scala:2 ] - | ^^^^^^^ - | -> def foo(): Int = A.a * 2 [ global-cycle2.scala:6 ] - | ^^^ + | Access uninitialized field value a. Calling trace: + | ├── object A { [ global-cycle2.scala:1 ] + | │ ^ + | ├── val a: Int = B.foo() [ global-cycle2.scala:2 ] + | │ ^^^^^^^ + | └── def foo(): Int = A.a * 2 [ global-cycle2.scala:6 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-cycle3.check b/tests/init-global/neg/global-cycle3.check index c8caac77ac40..1b3ccd8dd857 100644 --- a/tests/init-global/neg/global-cycle3.check +++ b/tests/init-global/neg/global-cycle3.check @@ -1,11 +1,11 @@ -- Warning: tests/init-global/neg/global-cycle3.scala:2:21 ------------------------------------------------------------- 2 | def foo(): Int = B.a + 10 | ^^^ - | Access uninitialized field value a. Call trace: - | -> object B { [ global-cycle3.scala:5 ] - | ^ - | -> val a: Int = A(4).foo() [ global-cycle3.scala:6 ] - | ^^^^^^^^^^ - | -> def foo(): Int = B.a + 10 [ global-cycle3.scala:2 ] - | ^^^ + | Access uninitialized field value a. Calling trace: + | ├── object B { [ global-cycle3.scala:5 ] + | │ ^ + | ├── val a: Int = A(4).foo() [ global-cycle3.scala:6 ] + | │ ^^^^^^^^^^ + | └── def foo(): Int = B.a + 10 [ global-cycle3.scala:2 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-cycle4.check b/tests/init-global/neg/global-cycle4.check index 39c08224c7ba..68a4dcae4b77 100644 --- a/tests/init-global/neg/global-cycle4.check +++ b/tests/init-global/neg/global-cycle4.check @@ -1,11 +1,11 @@ -- Warning: tests/init-global/neg/global-cycle4.scala:10:21 ------------------------------------------------------------ 10 | def foo(): Int = O.a + 10 | ^^^ - | Access uninitialized field value a. Call trace: - | -> object O { [ global-cycle4.scala:17 ] - | ^ - | -> val a: Int = D(5).bar().foo() [ global-cycle4.scala:18 ] - | ^^^^^^^^^^^^^^^^ - | -> def foo(): Int = O.a + 10 [ global-cycle4.scala:10 ] - | ^^^ + | Access uninitialized field value a. Calling trace: + | ├── object O { [ global-cycle4.scala:17 ] + | │ ^ + | ├── val a: Int = D(5).bar().foo() [ global-cycle4.scala:18 ] + | │ ^^^^^^^^^^^^^^^^ + | └── def foo(): Int = O.a + 10 [ global-cycle4.scala:10 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-cycle5.check b/tests/init-global/neg/global-cycle5.check index 494fed8a7dd3..c1d21cb77a45 100644 --- a/tests/init-global/neg/global-cycle5.check +++ b/tests/init-global/neg/global-cycle5.check @@ -2,9 +2,9 @@ 10 | val b: Int = A.a.foo() | ^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B { [ global-cycle5.scala:9 ] - | ^ - |-> val b: Int = A.a.foo() [ global-cycle5.scala:10 ] - | ^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B { [ global-cycle5.scala:9 ] + |│ ^ + |└── val b: Int = A.a.foo() [ global-cycle5.scala:10 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-cycle6.check b/tests/init-global/neg/global-cycle6.check index 5790b84bdb03..47a1c1543773 100644 --- a/tests/init-global/neg/global-cycle6.check +++ b/tests/init-global/neg/global-cycle6.check @@ -2,28 +2,28 @@ 1 |object A { | ^ | Cyclic initialization: object A -> object B -> object A. Calling trace: - | -> object A { [ global-cycle6.scala:1 ] - | ^ - | -> val n: Int = B.m [ global-cycle6.scala:2 ] - | ^ - | -> object B { [ global-cycle6.scala:8 ] - | ^ - | -> val a = new A.Inner [ global-cycle6.scala:9 ] - | ^^^^^^^^^^^ - | -> class Inner { [ global-cycle6.scala:3 ] - | ^ - | -> println(n) [ global-cycle6.scala:4 ] - | ^ + | ├── object A { [ global-cycle6.scala:1 ] + | │ ^ + | ├── val n: Int = B.m [ global-cycle6.scala:2 ] + | │ ^ + | ├── object B { [ global-cycle6.scala:8 ] + | │ ^ + | ├── val a = new A.Inner [ global-cycle6.scala:9 ] + | │ ^^^^^^^^^^^ + | ├── class Inner { [ global-cycle6.scala:3 ] + | │ ^ + | └── println(n) [ global-cycle6.scala:4 ] + | ^ -- Warning: tests/init-global/neg/global-cycle6.scala:4:12 ------------------------------------------------------------- 4 | println(n) | ^ - | Access uninitialized field value n. Call trace: - | -> object B { [ global-cycle6.scala:8 ] - | ^ - | -> val a = new A.Inner [ global-cycle6.scala:9 ] - | ^^^^^^^^^^^ - | -> class Inner { [ global-cycle6.scala:3 ] - | ^ - | -> println(n) [ global-cycle6.scala:4 ] - | ^ + | Access uninitialized field value n. Calling trace: + | ├── object B { [ global-cycle6.scala:8 ] + | │ ^ + | ├── val a = new A.Inner [ global-cycle6.scala:9 ] + | │ ^^^^^^^^^^^ + | ├── class Inner { [ global-cycle6.scala:3 ] + | │ ^ + | └── println(n) [ global-cycle6.scala:4 ] + | ^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-cycle7.check b/tests/init-global/neg/global-cycle7.check index e55192ebea8c..96a63b77b73e 100644 --- a/tests/init-global/neg/global-cycle7.check +++ b/tests/init-global/neg/global-cycle7.check @@ -2,20 +2,20 @@ 1 |object A { | ^ | Cyclic initialization: object A -> object B -> object A. Calling trace: - | -> object A { [ global-cycle7.scala:1 ] - | ^ - | -> val n: Int = B.m [ global-cycle7.scala:2 ] - | ^ - | -> object B { [ global-cycle7.scala:5 ] - | ^ - | -> val m: Int = A.n [ global-cycle7.scala:6 ] - | ^ + | ├── object A { [ global-cycle7.scala:1 ] + | │ ^ + | ├── val n: Int = B.m [ global-cycle7.scala:2 ] + | │ ^ + | ├── object B { [ global-cycle7.scala:5 ] + | │ ^ + | └── val m: Int = A.n [ global-cycle7.scala:6 ] + | ^ -- Warning: tests/init-global/neg/global-cycle7.scala:6:17 ------------------------------------------------------------- 6 | val m: Int = A.n | ^^^ - | Access uninitialized field value n. Call trace: - | -> object B { [ global-cycle7.scala:5 ] - | ^ - | -> val m: Int = A.n [ global-cycle7.scala:6 ] - | ^^^ + | Access uninitialized field value n. Calling trace: + | ├── object B { [ global-cycle7.scala:5 ] + | │ ^ + | └── val m: Int = A.n [ global-cycle7.scala:6 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-cycle8.check b/tests/init-global/neg/global-cycle8.check index b19272294bd5..6dc544fe8e7c 100644 --- a/tests/init-global/neg/global-cycle8.check +++ b/tests/init-global/neg/global-cycle8.check @@ -2,16 +2,16 @@ 9 |object O { | ^ | Cyclic initialization: object O -> object P -> object O. Calling trace: - | -> object O { [ global-cycle8.scala:9 ] - | ^ - | -> println(P.m) [ global-cycle8.scala:11 ] - | ^ - | -> object P { [ global-cycle8.scala:14 ] - | ^ - | -> val m = Q.bar(new B) [ global-cycle8.scala:15 ] - | ^^^^^^^^^^^^ - | -> def bar(b: B) = b.a.foo() [ global-cycle8.scala:19 ] - | ^^^^^^^^^ - | -> def foo() = println(O.n) [ global-cycle8.scala:2 ] - | ^ + | ├── object O { [ global-cycle8.scala:9 ] + | │ ^ + | ├── println(P.m) [ global-cycle8.scala:11 ] + | │ ^ + | ├── object P { [ global-cycle8.scala:14 ] + | │ ^ + | ├── val m = Q.bar(new B) [ global-cycle8.scala:15 ] + | │ ^^^^^^^^^^^^ + | ├── def bar(b: B) = b.a.foo() [ global-cycle8.scala:19 ] + | │ ^^^^^^^^^ + | └── def foo() = println(O.n) [ global-cycle8.scala:2 ] + | ^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-irrelevance1.check b/tests/init-global/neg/global-irrelevance1.check index 2f09978e3585..799d80ec9623 100644 --- a/tests/init-global/neg/global-irrelevance1.check +++ b/tests/init-global/neg/global-irrelevance1.check @@ -2,9 +2,9 @@ 5 | var y = A.x * 2 | ^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ global-irrelevance1.scala:4 ] - | ^ - |-> var y = A.x * 2 [ global-irrelevance1.scala:5 ] - | ^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ global-irrelevance1.scala:4 ] + |│ ^ + |└── var y = A.x * 2 [ global-irrelevance1.scala:5 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-irrelevance2.check b/tests/init-global/neg/global-irrelevance2.check index ab43e2c977ab..56263b936308 100644 --- a/tests/init-global/neg/global-irrelevance2.check +++ b/tests/init-global/neg/global-irrelevance2.check @@ -3,13 +3,12 @@ | ^^^^^^^^^^^^ | Mutating object A during initialization of object B. | Mutating other static objects during the initialization of one static object is forbidden. Calling trace: - | - | -> object B: [ global-irrelevance2.scala:7 ] - | ^ - | -> new B(10) [ global-irrelevance2.scala:8 ] - | ^^^^^^^^^ - | -> class B(b: Int): [ global-irrelevance2.scala:4 ] - | ^ - | -> A.x = b * 2 [ global-irrelevance2.scala:5 ] - | ^^^^^^^^^^^^ + | ├── object B: [ global-irrelevance2.scala:7 ] + | │ ^ + | ├── new B(10) [ global-irrelevance2.scala:8 ] + | │ ^^^^^^^^^ + | ├── class B(b: Int): [ global-irrelevance2.scala:4 ] + | │ ^ + | └── A.x = b * 2 [ global-irrelevance2.scala:5 ] + | ^^^^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-irrelevance3.check b/tests/init-global/neg/global-irrelevance3.check index 30abdff5da2a..7d7f9dbfb1fc 100644 --- a/tests/init-global/neg/global-irrelevance3.check +++ b/tests/init-global/neg/global-irrelevance3.check @@ -2,11 +2,11 @@ 9 | (() => x) | ^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ global-irrelevance3.scala:13 ] - | ^ - |-> var y = A.p.g() [ global-irrelevance3.scala:14 ] - | ^^^^^^^ - |-> (() => x) [ global-irrelevance3.scala:9 ] - | ^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ global-irrelevance3.scala:13 ] + |│ ^ + |├── var y = A.p.g() [ global-irrelevance3.scala:14 ] + |│ ^^^^^^^ + |└── (() => x) [ global-irrelevance3.scala:9 ] + | ^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-irrelevance4.check b/tests/init-global/neg/global-irrelevance4.check index 447ca27a4ed3..ebabde96294d 100644 --- a/tests/init-global/neg/global-irrelevance4.check +++ b/tests/init-global/neg/global-irrelevance4.check @@ -3,11 +3,10 @@ | ^^^^^^^^^^ | Mutating object A during initialization of object B. | Mutating other static objects during the initialization of one static object is forbidden. Calling trace: - | - | -> object B: [ global-irrelevance4.scala:12 ] - | ^ - | -> A.p.f(10) [ global-irrelevance4.scala:13 ] - | ^^^^^^^^^ - | -> (y => x = y), [ global-irrelevance4.scala:8 ] - | ^^^^^^^^^^ + | ├── object B: [ global-irrelevance4.scala:12 ] + | │ ^ + | ├── A.p.f(10) [ global-irrelevance4.scala:13 ] + | │ ^^^^^^^^^ + | └── (y => x = y), [ global-irrelevance4.scala:8 ] + | ^^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-irrelevance5.check b/tests/init-global/neg/global-irrelevance5.check index af8a6ab6568d..7d472621821c 100644 --- a/tests/init-global/neg/global-irrelevance5.check +++ b/tests/init-global/neg/global-irrelevance5.check @@ -2,9 +2,9 @@ 6 | var y = A.array(0) * 2 | ^^^^^^^^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ global-irrelevance5.scala:5 ] - | ^ - |-> var y = A.array(0) * 2 [ global-irrelevance5.scala:6 ] - | ^^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ global-irrelevance5.scala:5 ] + |│ ^ + |└── var y = A.array(0) * 2 [ global-irrelevance5.scala:6 ] + | ^^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-irrelevance6.check b/tests/init-global/neg/global-irrelevance6.check index 8b30051e67b8..52df6bd253e2 100644 --- a/tests/init-global/neg/global-irrelevance6.check +++ b/tests/init-global/neg/global-irrelevance6.check @@ -2,9 +2,9 @@ 9 | var y = A.array(0).foo() * 2 | ^^^^^^^^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ global-irrelevance6.scala:8 ] - | ^ - |-> var y = A.array(0).foo() * 2 [ global-irrelevance6.scala:9 ] - | ^^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ global-irrelevance6.scala:8 ] + |│ ^ + |└── var y = A.array(0).foo() * 2 [ global-irrelevance6.scala:9 ] + | ^^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-irrelevance7.check b/tests/init-global/neg/global-irrelevance7.check index 37fab85ca045..3178c21cbca5 100644 --- a/tests/init-global/neg/global-irrelevance7.check +++ b/tests/init-global/neg/global-irrelevance7.check @@ -2,9 +2,9 @@ 10 | var y = A.array(0).foo() * 2 | ^^^^^^^^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ global-irrelevance7.scala:9 ] - | ^ - |-> var y = A.array(0).foo() * 2 [ global-irrelevance7.scala:10 ] - | ^^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ global-irrelevance7.scala:9 ] + |│ ^ + |└── var y = A.array(0).foo() * 2 [ global-irrelevance7.scala:10 ] + | ^^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-list.check b/tests/init-global/neg/global-list.check index 806f61b4c570..4d4bc3d7e8ca 100644 --- a/tests/init-global/neg/global-list.check +++ b/tests/init-global/neg/global-list.check @@ -2,36 +2,36 @@ 3 |object O: | ^ | Cyclic initialization: object O -> object Foo -> object O. Calling trace: - | -> object O: [ global-list.scala:3 ] - | ^ - | -> val a = Foo("Apple") [ global-list.scala:4 ] - | ^^^ - | -> object Foo: [ global-list.scala:8 ] - | ^ - | -> val all: List[Foo] = List(O.a, O.b, O.c) [ global-list.scala:9 ] - | ^ + | ├── object O: [ global-list.scala:3 ] + | │ ^ + | ├── val a = Foo("Apple") [ global-list.scala:4 ] + | │ ^^^ + | ├── object Foo: [ global-list.scala:8 ] + | │ ^ + | └── val all: List[Foo] = List(O.a, O.b, O.c) [ global-list.scala:9 ] + | ^ -- Warning: tests/init-global/neg/global-list.scala:9:30 --------------------------------------------------------------- 9 | val all: List[Foo] = List(O.a, O.b, O.c) | ^^^ - | Access uninitialized field value a. Call trace: - | -> object Foo: [ global-list.scala:8 ] - | ^ - | -> val all: List[Foo] = List(O.a, O.b, O.c) [ global-list.scala:9 ] - | ^^^ + | Access uninitialized field value a. Calling trace: + | ├── object Foo: [ global-list.scala:8 ] + | │ ^ + | └── val all: List[Foo] = List(O.a, O.b, O.c) [ global-list.scala:9 ] + | ^^^ -- Warning: tests/init-global/neg/global-list.scala:9:35 --------------------------------------------------------------- 9 | val all: List[Foo] = List(O.a, O.b, O.c) | ^^^ - | Access uninitialized field value b. Call trace: - | -> object Foo: [ global-list.scala:8 ] - | ^ - | -> val all: List[Foo] = List(O.a, O.b, O.c) [ global-list.scala:9 ] - | ^^^ + | Access uninitialized field value b. Calling trace: + | ├── object Foo: [ global-list.scala:8 ] + | │ ^ + | └── val all: List[Foo] = List(O.a, O.b, O.c) [ global-list.scala:9 ] + | ^^^ -- Warning: tests/init-global/neg/global-list.scala:9:40 --------------------------------------------------------------- 9 | val all: List[Foo] = List(O.a, O.b, O.c) | ^^^ - | Access uninitialized field value c. Call trace: - | -> object Foo: [ global-list.scala:8 ] - | ^ - | -> val all: List[Foo] = List(O.a, O.b, O.c) [ global-list.scala:9 ] - | ^^^ + | Access uninitialized field value c. Calling trace: + | ├── object Foo: [ global-list.scala:8 ] + | │ ^ + | └── val all: List[Foo] = List(O.a, O.b, O.c) [ global-list.scala:9 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-local-var.check b/tests/init-global/neg/global-local-var.check index 765e727f58e8..bbedc06dce3d 100644 --- a/tests/init-global/neg/global-local-var.check +++ b/tests/init-global/neg/global-local-var.check @@ -1,13 +1,13 @@ -- Warning: tests/init-global/neg/global-local-var.scala:10:6 ---------------------------------------------------------- 10 | B.a + 10 + sum | ^^^ - | Access uninitialized field value a. Call trace: - | -> object B { [ global-local-var.scala:14 ] - | ^ - | -> val a: Int = A(4).foo() [ global-local-var.scala:15 ] - | ^^^^^^^^^^ - | -> def foo(): Int = { [ global-local-var.scala:2 ] - | ^ - | -> B.a + 10 + sum [ global-local-var.scala:10 ] - | ^^^ + | Access uninitialized field value a. Calling trace: + | ├── object B { [ global-local-var.scala:14 ] + | │ ^ + | ├── val a: Int = A(4).foo() [ global-local-var.scala:15 ] + | │ ^^^^^^^^^^ + | ├── def foo(): Int = { [ global-local-var.scala:2 ] + | │ ^ + | └── B.a + 10 + sum [ global-local-var.scala:10 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/global-region1.check b/tests/init-global/neg/global-region1.check index 25a5359e30a2..b3b7e2a3b7ca 100644 --- a/tests/init-global/neg/global-region1.check +++ b/tests/init-global/neg/global-region1.check @@ -1,11 +1,11 @@ -- Warning: tests/init-global/neg/global-region1.scala:3:51 ------------------------------------------------------------ 3 |class D(var y: Int) extends B { def foo(): Int = A.m } | ^^^ - | Access uninitialized field value m. Call trace: - | -> object A: [ global-region1.scala:6 ] - | ^ - | -> val m: Int = box1.value.foo() [ global-region1.scala:9 ] - | ^^^^^^^^^^^^^^^^ - | -> class D(var y: Int) extends B { def foo(): Int = A.m } [ global-region1.scala:3 ] + | Access uninitialized field value m. Calling trace: + | ├── object A: [ global-region1.scala:6 ] + | │ ^ + | ├── val m: Int = box1.value.foo() [ global-region1.scala:9 ] + | │ ^^^^^^^^^^^^^^^^ + | └── class D(var y: Int) extends B { def foo(): Int = A.m } [ global-region1.scala:3 ] | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/i11262.check b/tests/init-global/neg/i11262.check index abb72702722c..643a70838167 100644 --- a/tests/init-global/neg/i11262.check +++ b/tests/init-global/neg/i11262.check @@ -2,14 +2,14 @@ 1 |object A { val x: String = B.y } | ^ | Cyclic initialization: object A -> object B -> object A. Calling trace: - | -> object A { val x: String = B.y } [ i11262.scala:1 ] - | ^ - | -> object B { val y: String = A.x } [ i11262.scala:2 ] - | ^ + | ├── object A { val x: String = B.y } [ i11262.scala:1 ] + | │ ^ + | └── object B { val y: String = A.x } [ i11262.scala:2 ] + | ^ -- Warning: tests/init-global/neg/i11262.scala:2:29 -------------------------------------------------------------------- 2 |object B { val y: String = A.x } | ^^^ - | Access uninitialized field value x. Call trace: - | -> object B { val y: String = A.x } [ i11262.scala:2 ] - | ^^^ + | Access uninitialized field value x. Calling trace: + | └── object B { val y: String = A.x } [ i11262.scala:2 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/i12544b.check b/tests/init-global/neg/i12544b.check index fa03c4a2a336..7680b62d0b7b 100644 --- a/tests/init-global/neg/i12544b.check +++ b/tests/init-global/neg/i12544b.check @@ -2,20 +2,20 @@ 5 | object nested: | ^ | Cyclic initialization: object nested -> object Enum -> object nested. Calling trace: - | -> object nested: [ i12544b.scala:5 ] - | ^ - | -> val a: Enum = Case [ i12544b.scala:6 ] - | ^^^^ - | -> object Enum: [ i12544b.scala:4 ] - | ^ - | -> val b: Enum = f(nested.a) [ i12544b.scala:8 ] - | ^^^^^^ + | ├── object nested: [ i12544b.scala:5 ] + | │ ^ + | ├── val a: Enum = Case [ i12544b.scala:6 ] + | │ ^^^^ + | ├── object Enum: [ i12544b.scala:4 ] + | │ ^ + | └── val b: Enum = f(nested.a) [ i12544b.scala:8 ] + | ^^^^^^ -- Warning: tests/init-global/neg/i12544b.scala:8:25 ------------------------------------------------------------------- 8 | val b: Enum = f(nested.a) | ^^^^^^^^ - | Access uninitialized field value a. Call trace: - | -> object Enum: [ i12544b.scala:4 ] - | ^ - | -> val b: Enum = f(nested.a) [ i12544b.scala:8 ] - | ^^^^^^^^ + | Access uninitialized field value a. Calling trace: + | ├── object Enum: [ i12544b.scala:4 ] + | │ ^ + | └── val b: Enum = f(nested.a) [ i12544b.scala:8 ] + | ^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/i9176.check b/tests/init-global/neg/i9176.check index 92f9e31288bc..a26b66081d75 100644 --- a/tests/init-global/neg/i9176.check +++ b/tests/init-global/neg/i9176.check @@ -2,8 +2,8 @@ 2 |case object A extends Foo(B) | ^ | Cyclic initialization: object A -> object B -> object A. Calling trace: - | -> case object A extends Foo(B) [ i9176.scala:2 ] - | ^ - | -> case object B extends Foo(A) [ i9176.scala:3 ] - | ^ + | ├── case object A extends Foo(B) [ i9176.scala:2 ] + | │ ^ + | └── case object B extends Foo(A) [ i9176.scala:3 ] + | ^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/mutable-array.check b/tests/init-global/neg/mutable-array.check index 794ace19f512..9a877be4eff4 100644 --- a/tests/init-global/neg/mutable-array.check +++ b/tests/init-global/neg/mutable-array.check @@ -2,9 +2,9 @@ 8 | val x: Int = box.value | ^^^^^^^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ mutable-array.scala:5 ] - | ^ - |-> val x: Int = box.value [ mutable-array.scala:8 ] - | ^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ mutable-array.scala:5 ] + |│ ^ + |└── val x: Int = box.value [ mutable-array.scala:8 ] + | ^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/mutable-read1.check b/tests/init-global/neg/mutable-read1.check index 159f01985eea..4e446490d7e5 100644 --- a/tests/init-global/neg/mutable-read1.check +++ b/tests/init-global/neg/mutable-read1.check @@ -2,9 +2,9 @@ 10 | val n: Int = boxA.value | ^^^^^^^^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ mutable-read1.scala:6 ] - | ^ - |-> val n: Int = boxA.value [ mutable-read1.scala:10 ] - | ^^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ mutable-read1.scala:6 ] + |│ ^ + |└── val n: Int = boxA.value [ mutable-read1.scala:10 ] + | ^^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/mutable-read2.check b/tests/init-global/neg/mutable-read2.check index 1bb8e07c0429..24c3c0ef3789 100644 --- a/tests/init-global/neg/mutable-read2.check +++ b/tests/init-global/neg/mutable-read2.check @@ -2,9 +2,9 @@ 10 | val b: Int = box.value | ^^^^^^^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ mutable-read2.scala:7 ] - | ^ - |-> val b: Int = box.value [ mutable-read2.scala:10 ] - | ^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ mutable-read2.scala:7 ] + |│ ^ + |└── val b: Int = box.value [ mutable-read2.scala:10 ] + | ^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/mutable-read3.check b/tests/init-global/neg/mutable-read3.check index d0e194093f2e..e0eeb62cee63 100644 --- a/tests/init-global/neg/mutable-read3.check +++ b/tests/init-global/neg/mutable-read3.check @@ -2,9 +2,9 @@ 9 | val x: Int = box.value | ^^^^^^^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ mutable-read3.scala:5 ] - | ^ - |-> val x: Int = box.value [ mutable-read3.scala:9 ] - | ^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ mutable-read3.scala:5 ] + |│ ^ + |└── val x: Int = box.value [ mutable-read3.scala:9 ] + | ^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/mutable-read4.check b/tests/init-global/neg/mutable-read4.check index 9ed8f6d6c49d..81f3a68e0f8b 100644 --- a/tests/init-global/neg/mutable-read4.check +++ b/tests/init-global/neg/mutable-read4.check @@ -2,9 +2,9 @@ 10 | val n: Int = boxA.value | ^^^^^^^^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ mutable-read4.scala:6 ] - | ^ - |-> val n: Int = boxA.value [ mutable-read4.scala:10 ] - | ^^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ mutable-read4.scala:6 ] + |│ ^ + |└── val n: Int = boxA.value [ mutable-read4.scala:10 ] + | ^^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/mutable-read5.check b/tests/init-global/neg/mutable-read5.check index 6b84d329188a..0fa788588d97 100644 --- a/tests/init-global/neg/mutable-read5.check +++ b/tests/init-global/neg/mutable-read5.check @@ -2,11 +2,11 @@ 4 | def name(s: String): Name = Name(0, chrs.length) | ^^^^ |Reading mutable state of object Names during initialization of object StdNames. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object StdNames: [ mutable-read5.scala:6 ] - | ^ - |-> val AnyRef: Names.Name = Names.name("AnyRef") [ mutable-read5.scala:7 ] - | ^^^^^^^^^^^^^^^^^^^^ - |-> def name(s: String): Name = Name(0, chrs.length) [ mutable-read5.scala:4 ] - | ^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object StdNames: [ mutable-read5.scala:6 ] + |│ ^ + |├── val AnyRef: Names.Name = Names.name("AnyRef") [ mutable-read5.scala:7 ] + |│ ^^^^^^^^^^^^^^^^^^^^ + |└── def name(s: String): Name = Name(0, chrs.length) [ mutable-read5.scala:4 ] + | ^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/mutable-read6.check b/tests/init-global/neg/mutable-read6.check index ceb2928ba654..a43e62bafae0 100644 --- a/tests/init-global/neg/mutable-read6.check +++ b/tests/init-global/neg/mutable-read6.check @@ -2,11 +2,11 @@ 7 | final def source: SourceFile = _source | ^^^^^^^ |Reading mutable state of object Contexts during initialization of object Implicits. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object Implicits: [ mutable-read6.scala:12 ] - | ^ - |-> val NoMatchingFailure: SearchFailure = SearchFailure(1, NoContext.source) [ mutable-read6.scala:15 ] - | ^^^^^^^^^^^^^^^^ - |-> final def source: SourceFile = _source [ mutable-read6.scala:7 ] - | ^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object Implicits: [ mutable-read6.scala:12 ] + |│ ^ + |├── val NoMatchingFailure: SearchFailure = SearchFailure(1, NoContext.source) [ mutable-read6.scala:15 ] + |│ ^^^^^^^^^^^^^^^^ + |└── final def source: SourceFile = _source [ mutable-read6.scala:7 ] + | ^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/mutable-read7.check b/tests/init-global/neg/mutable-read7.check index fd7139b14b19..5198721ebf40 100644 --- a/tests/init-global/neg/mutable-read7.check +++ b/tests/init-global/neg/mutable-read7.check @@ -2,15 +2,15 @@ 7 | if (Positioned.debug) { | ^^^^^^^^^^^^^^^^ |Reading mutable state of object Positioned during initialization of object Trees. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object Trees: [ mutable-read7.scala:11 ] - | ^ - |-> val emptyTree = new Tree [ mutable-read7.scala:13 ] - | ^^^^^^^^ - |-> class Tree extends Positioned [ mutable-read7.scala:12 ] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - |-> abstract class Positioned: [ mutable-read7.scala:6 ] - | ^ - |-> if (Positioned.debug) { [ mutable-read7.scala:7 ] - | ^^^^^^^^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object Trees: [ mutable-read7.scala:11 ] + |│ ^ + |├── val emptyTree = new Tree [ mutable-read7.scala:13 ] + |│ ^^^^^^^^ + |├── class Tree extends Positioned [ mutable-read7.scala:12 ] + |│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + |├── abstract class Positioned: [ mutable-read7.scala:6 ] + |│ ^ + |└── if (Positioned.debug) { [ mutable-read7.scala:7 ] + | ^^^^^^^^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/mutable-read8.check b/tests/init-global/neg/mutable-read8.check index 3598228f24a9..030208a605dd 100644 --- a/tests/init-global/neg/mutable-read8.check +++ b/tests/init-global/neg/mutable-read8.check @@ -2,13 +2,13 @@ 6 | if (Stats.monitored) println("record stats") | ^^^^^^^^^^^^^^^ |Reading mutable state of object Stats during initialization of object NoCompleter. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object NoCompleter extends LazyType [ mutable-read8.scala:11 ] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - |-> class LazyType extends UncachedGroundType [ mutable-read8.scala:9 ] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - |-> class UncachedGroundType { [ mutable-read8.scala:5 ] - | ^ - |-> if (Stats.monitored) println("record stats") [ mutable-read8.scala:6 ] - | ^^^^^^^^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object NoCompleter extends LazyType [ mutable-read8.scala:11 ] + |│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + |├── class LazyType extends UncachedGroundType [ mutable-read8.scala:9 ] + |│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + |├── class UncachedGroundType { [ mutable-read8.scala:5 ] + |│ ^ + |└── if (Stats.monitored) println("record stats") [ mutable-read8.scala:6 ] + | ^^^^^^^^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/partial-ordering.check b/tests/init-global/neg/partial-ordering.check index 5db1fdc9d873..d7a71995dd4c 100644 --- a/tests/init-global/neg/partial-ordering.check +++ b/tests/init-global/neg/partial-ordering.check @@ -2,12 +2,12 @@ 1 |object Names: | ^ | Cyclic initialization: object Names -> object MethodName -> object Names. Calling trace: - | -> object Names: [ partial-ordering.scala:1 ] - | ^ - | -> val ctorName: MethodName = MethodName.apply(ctorString) [ partial-ordering.scala:3 ] - | ^^^^^^^^^^ - | -> object MethodName: [ partial-ordering.scala:6 ] - | ^ - | -> val ctor: MethodName = new MethodName(Names.ctorString) [ partial-ordering.scala:7 ] - | ^^^^^ + | ├── object Names: [ partial-ordering.scala:1 ] + | │ ^ + | ├── val ctorName: MethodName = MethodName.apply(ctorString) [ partial-ordering.scala:3 ] + | │ ^^^^^^^^^^ + | ├── object MethodName: [ partial-ordering.scala:6 ] + | │ ^ + | └── val ctor: MethodName = new MethodName(Names.ctorString) [ partial-ordering.scala:7 ] + | ^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/patmat-unapplySeq2.check b/tests/init-global/neg/patmat-unapplySeq2.check index a545af8e9dee..57a67452c10f 100644 --- a/tests/init-global/neg/patmat-unapplySeq2.check +++ b/tests/init-global/neg/patmat-unapplySeq2.check @@ -2,11 +2,11 @@ 8 | def apply(i: Int): Box = array(i) | ^^^^^^^^ |Reading mutable state of object A during initialization of object B. - |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: - |-> object B: [ patmat-unapplySeq2.scala:15 ] - | ^ - |-> case A(b*) => [ patmat-unapplySeq2.scala:17 ] - | ^^^^^ - |-> def apply(i: Int): Box = array(i) [ patmat-unapplySeq2.scala:8 ] - | ^^^^^^^^ + |Reading mutable state of other static objects is forbidden as it breaks initialization-time irrelevance. Calling trace: + |├── object B: [ patmat-unapplySeq2.scala:15 ] + |│ ^ + |├── case A(b*) => [ patmat-unapplySeq2.scala:17 ] + |│ ^^^^^ + |└── def apply(i: Int): Box = array(i) [ patmat-unapplySeq2.scala:8 ] + | ^^^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/patmat.check b/tests/init-global/neg/patmat.check index 9c77fb554aae..e05d144db7ce 100644 --- a/tests/init-global/neg/patmat.check +++ b/tests/init-global/neg/patmat.check @@ -2,26 +2,26 @@ 1 |object A: | ^ | Cyclic initialization: object A -> object B -> object A. Calling trace: - | -> object A: [ patmat.scala:1 ] - | ^ - | -> case Some(x) => println(x * 2 + B.a.size) [ patmat.scala:4 ] - | ^ - | -> object B: [ patmat.scala:7 ] - | ^ - | -> if A.a.isEmpty then println(xs.size) [ patmat.scala:12 ] - | ^ + | ├── object A: [ patmat.scala:1 ] + | │ ^ + | ├── case Some(x) => println(x * 2 + B.a.size) [ patmat.scala:4 ] + | │ ^ + | ├── object B: [ patmat.scala:7 ] + | │ ^ + | └── if A.a.isEmpty then println(xs.size) [ patmat.scala:12 ] + | ^ -- Warning: tests/init-global/neg/patmat.scala:29:9 -------------------------------------------------------------------- 29 | object Inner: | ^ | Cyclic initialization: object Inner -> object C -> object Inner. Calling trace: - | -> object Inner: [ patmat.scala:29 ] - | ^ - | -> case Box(f) => f() [ patmat.scala:35 ] - | ^^^ - | -> val foo: () => Int = () => C.a [ patmat.scala:32 ] - | ^ - | -> object C: [ patmat.scala:18 ] - | ^ - | -> val a: Int = Inner.b [ patmat.scala:27 ] - | ^^^^^ + | ├── object Inner: [ patmat.scala:29 ] + | │ ^ + | ├── case Box(f) => f() [ patmat.scala:35 ] + | │ ^^^ + | ├── val foo: () => Int = () => C.a [ patmat.scala:32 ] + | │ ^ + | ├── object C: [ patmat.scala:18 ] + | │ ^ + | └── val a: Int = Inner.b [ patmat.scala:27 ] + | ^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/return.check b/tests/init-global/neg/return.check index 158913326a9a..a420b2bab4c3 100644 --- a/tests/init-global/neg/return.check +++ b/tests/init-global/neg/return.check @@ -1,11 +1,11 @@ -- Warning: tests/init-global/neg/return.scala:4:31 -------------------------------------------------------------------- 4 | return (a: Int) => a + B.n | ^^^ - | Access uninitialized field value n. Call trace: - | -> object B: [ return.scala:8 ] - | ^ - | -> val n = A.foo(-10)(20) [ return.scala:9 ] - | ^^^^^^^^^^^^^^ - | -> return (a: Int) => a + B.n [ return.scala:4 ] - | ^^^ + | Access uninitialized field value n. Calling trace: + | ├── object B: [ return.scala:8 ] + | │ ^ + | ├── val n = A.foo(-10)(20) [ return.scala:9 ] + | │ ^^^^^^^^^^^^^^ + | └── return (a: Int) => a + B.n [ return.scala:4 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/return2.check b/tests/init-global/neg/return2.check index 5f2f9fb3cbab..e0d9a6e33b14 100644 --- a/tests/init-global/neg/return2.check +++ b/tests/init-global/neg/return2.check @@ -1,13 +1,13 @@ -- Warning: tests/init-global/neg/return2.scala:3:30 ------------------------------------------------------------------- 3 | val f = (a: Int) => a + B.n | ^^^ - | Access uninitialized field value n. Call trace: - | -> object B: [ return2.scala:12 ] - | ^ - | -> val n = A.foo(-10)(20) [ return2.scala:13 ] - | ^^^^^^^^^^^^^^ - | -> val f = (a: Int) => a + B.n [ return2.scala:3 ] - | ^^^ + | Access uninitialized field value n. Calling trace: + | ├── object B: [ return2.scala:12 ] + | │ ^ + | ├── val n = A.foo(-10)(20) [ return2.scala:13 ] + | │ ^^^^^^^^^^^^^^ + | └── val f = (a: Int) => a + B.n [ return2.scala:3 ] + | ^^^ -- Warning: tests/init-global/neg/return2.scala:6:18 ------------------------------------------------------------------- 6 | val g = () => return f | ^^^^^^^^ diff --git a/tests/init-global/neg/t5366.check b/tests/init-global/neg/t5366.check index 01db17c85f8e..3aeda68fd96f 100644 --- a/tests/init-global/neg/t5366.check +++ b/tests/init-global/neg/t5366.check @@ -2,20 +2,20 @@ 3 |case object ObjA extends IdAndMsg(1) | ^ | Cyclic initialization: object ObjA -> object IdAndMsg -> object ObjA. Calling trace: - | -> case object ObjA extends IdAndMsg(1) [ t5366.scala:3 ] - | ^ - | -> object IdAndMsg { [ t5366.scala:6 ] - | ^ - | -> val values = List(ObjA , ObjB) [ t5366.scala:7 ] - | ^^^^ + | ├── case object ObjA extends IdAndMsg(1) [ t5366.scala:3 ] + | │ ^ + | ├── object IdAndMsg { [ t5366.scala:6 ] + | │ ^ + | └── val values = List(ObjA , ObjB) [ t5366.scala:7 ] + | ^^^^ -- Warning: tests/init-global/neg/t5366.scala:6:7 ---------------------------------------------------------------------- 6 |object IdAndMsg { | ^ | Cyclic initialization: object IdAndMsg -> object ObjB -> object IdAndMsg. Calling trace: - | -> object IdAndMsg { [ t5366.scala:6 ] - | ^ - | -> val values = List(ObjA , ObjB) [ t5366.scala:7 ] - | ^^^^ - | -> case object ObjB extends IdAndMsg(2) [ t5366.scala:4 ] - | ^ + | ├── object IdAndMsg { [ t5366.scala:6 ] + | │ ^ + | ├── val values = List(ObjA , ObjB) [ t5366.scala:7 ] + | │ ^^^^ + | └── case object ObjB extends IdAndMsg(2) [ t5366.scala:4 ] + | ^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/t9115.check b/tests/init-global/neg/t9115.check index bd90efaf526d..a55c2eb151a1 100644 --- a/tests/init-global/neg/t9115.check +++ b/tests/init-global/neg/t9115.check @@ -2,20 +2,20 @@ 4 | case object D1 extends Z(aaa) | ^ | Cyclic initialization: object D1 -> object D -> object D1. Calling trace: - | -> case object D1 extends Z(aaa) [ t9115.scala:4 ] - | ^^^ - | -> object D { [ t9115.scala:1 ] - | ^ - | -> println(D1) [ t9115.scala:6 ] - | ^^ + | ├── case object D1 extends Z(aaa) [ t9115.scala:4 ] + | │ ^^^ + | ├── object D { [ t9115.scala:1 ] + | │ ^ + | └── println(D1) [ t9115.scala:6 ] + | ^^ -- Warning: tests/init-global/neg/t9115.scala:1:7 ---------------------------------------------------------------------- 1 |object D { | ^ | Cyclic initialization: object D -> object D2 -> object D. Calling trace: - | -> object D { [ t9115.scala:1 ] - | ^ - | -> println(D2) [ t9115.scala:7 ] - | ^^ - | -> case object D2 extends Z(aaa) // 'null' when calling D.D2 first time [ t9115.scala:5 ] - | ^^^ + | ├── object D { [ t9115.scala:1 ] + | │ ^ + | ├── println(D2) [ t9115.scala:7 ] + | │ ^^ + | └── case object D2 extends Z(aaa) // 'null' when calling D.D2 first time [ t9115.scala:5 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/t9261.check b/tests/init-global/neg/t9261.check index 79dc40d0351c..dbda32347e74 100644 --- a/tests/init-global/neg/t9261.check +++ b/tests/init-global/neg/t9261.check @@ -2,8 +2,8 @@ 2 |case object Buy extends OrderType(Sell) | ^ | Cyclic initialization: object Buy -> object Sell -> object Buy. Calling trace: - | -> case object Buy extends OrderType(Sell) [ t9261.scala:2 ] - | ^^^^ - | -> case object Sell extends OrderType(Buy) [ t9261.scala:3 ] - | ^^^ + | ├── case object Buy extends OrderType(Sell) [ t9261.scala:2 ] + | │ ^^^^ + | └── case object Sell extends OrderType(Buy) [ t9261.scala:3 ] + | ^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/t9312.check b/tests/init-global/neg/t9312.check index 4a6e733dd148..d6f1b00b1a09 100644 --- a/tests/init-global/neg/t9312.check +++ b/tests/init-global/neg/t9312.check @@ -2,28 +2,28 @@ 18 | object Child1 extends Child | ^ | Cyclic initialization: object Child1 -> object Parent -> object Child1. Calling trace: - | -> object Child1 extends Child [ t9312.scala:18 ] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -> trait Child { [ t9312.scala:12 ] - | ^ - | -> val parent = Parent [ t9312.scala:14 ] - | ^^^^^^ - | -> object Parent { [ t9312.scala:11 ] - | ^ - | -> final val children = Set(Child1, Child2) [ t9312.scala:21 ] - | ^^^^^^ + | ├── object Child1 extends Child [ t9312.scala:18 ] + | │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ├── trait Child { [ t9312.scala:12 ] + | │ ^ + | ├── val parent = Parent [ t9312.scala:14 ] + | │ ^^^^^^ + | ├── object Parent { [ t9312.scala:11 ] + | │ ^ + | └── final val children = Set(Child1, Child2) [ t9312.scala:21 ] + | ^^^^^^ -- Warning: tests/init-global/neg/t9312.scala:11:9 --------------------------------------------------------------------- 11 | object Parent { | ^ | Cyclic initialization: object Parent -> object Child2 -> object Parent. Calling trace: - | -> object Parent { [ t9312.scala:11 ] - | ^ - | -> final val children = Set(Child1, Child2) [ t9312.scala:21 ] - | ^^^^^^ - | -> object Child2 extends Child [ t9312.scala:19 ] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -> trait Child { [ t9312.scala:12 ] - | ^ - | -> val parent = Parent [ t9312.scala:14 ] - | ^^^^^^ + | ├── object Parent { [ t9312.scala:11 ] + | │ ^ + | ├── final val children = Set(Child1, Child2) [ t9312.scala:21 ] + | │ ^^^^^^ + | ├── object Child2 extends Child [ t9312.scala:19 ] + | │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ├── trait Child { [ t9312.scala:12 ] + | │ ^ + | └── val parent = Parent [ t9312.scala:14 ] + | ^^^^^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/t9360.check b/tests/init-global/neg/t9360.check index e27ea4d5d26b..23ceea224a10 100644 --- a/tests/init-global/neg/t9360.check +++ b/tests/init-global/neg/t9360.check @@ -2,20 +2,20 @@ 8 | object AObj extends BaseClass(s) | ^ | Cyclic initialization: object AObj -> object Obj -> object AObj. Calling trace: - | -> object AObj extends BaseClass(s) [ t9360.scala:8 ] - | ^ - | -> object Obj { [ t9360.scala:5 ] - | ^ - | -> val list = List(AObj, BObj) [ t9360.scala:12 ] - | ^^^^ + | ├── object AObj extends BaseClass(s) [ t9360.scala:8 ] + | │ ^ + | ├── object Obj { [ t9360.scala:5 ] + | │ ^ + | └── val list = List(AObj, BObj) [ t9360.scala:12 ] + | ^^^^ -- Warning: tests/init-global/neg/t9360.scala:5:7 ---------------------------------------------------------------------- 5 |object Obj { | ^ | Cyclic initialization: object Obj -> object BObj -> object Obj. Calling trace: - | -> object Obj { [ t9360.scala:5 ] - | ^ - | -> val list = List(AObj, BObj) [ t9360.scala:12 ] - | ^^^^ - | -> object BObj extends BaseClass(s) [ t9360.scala:10 ] - | ^ + | ├── object Obj { [ t9360.scala:5 ] + | │ ^ + | ├── val list = List(AObj, BObj) [ t9360.scala:12 ] + | │ ^^^^ + | └── object BObj extends BaseClass(s) [ t9360.scala:10 ] + | ^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/unapply-implicit-arg.check b/tests/init-global/neg/unapply-implicit-arg.check index 8d4e1d9c9aa2..4e45d79e7e14 100644 --- a/tests/init-global/neg/unapply-implicit-arg.check +++ b/tests/init-global/neg/unapply-implicit-arg.check @@ -1,9 +1,9 @@ -- Warning: tests/init-global/neg/unapply-implicit-arg.scala:11:16 ----------------------------------------------------- 11 | val i2: Int = i2 match | ^^ - | Access uninitialized field value i2. Call trace: - | -> object Bar { [ unapply-implicit-arg.scala:1 ] - | ^ - | -> val i2: Int = i2 match [ unapply-implicit-arg.scala:11 ] - | ^^ + | Access uninitialized field value i2. Calling trace: + | ├── object Bar { [ unapply-implicit-arg.scala:1 ] + | │ ^ + | └── val i2: Int = i2 match [ unapply-implicit-arg.scala:11 ] + | ^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/unapply-implicit-arg2.check b/tests/init-global/neg/unapply-implicit-arg2.check index 3d045e1b92a7..ec317d59f1bd 100644 --- a/tests/init-global/neg/unapply-implicit-arg2.check +++ b/tests/init-global/neg/unapply-implicit-arg2.check @@ -1,13 +1,13 @@ -- Warning: tests/init-global/neg/unapply-implicit-arg2.scala:7:51 ----------------------------------------------------- 7 | if i == 0 then Some(f1.m1(i1)) else Some(f1.m2(i2)) | ^^ - | Access uninitialized field value i2. Call trace: - | -> object Bar { [ unapply-implicit-arg2.scala:1 ] - | ^ - | -> case Bar(i) => i [ unapply-implicit-arg2.scala:12 ] - | ^^^^^^ - | -> def unapply(using f1: Foo)(i: Int): Option[Int] = [ unapply-implicit-arg2.scala:6 ] - | ^ - | -> if i == 0 then Some(f1.m1(i1)) else Some(f1.m2(i2)) [ unapply-implicit-arg2.scala:7 ] + | Access uninitialized field value i2. Calling trace: + | ├── object Bar { [ unapply-implicit-arg2.scala:1 ] + | │ ^ + | ├── case Bar(i) => i [ unapply-implicit-arg2.scala:12 ] + | │ ^^^^^^ + | ├── def unapply(using f1: Foo)(i: Int): Option[Int] = [ unapply-implicit-arg2.scala:6 ] + | │ ^ + | └── if i == 0 then Some(f1.m1(i1)) else Some(f1.m2(i2)) [ unapply-implicit-arg2.scala:7 ] | ^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/unapply-implicit-arg3.check b/tests/init-global/neg/unapply-implicit-arg3.check index f402063704ff..3bb9c0ad2930 100644 --- a/tests/init-global/neg/unapply-implicit-arg3.check +++ b/tests/init-global/neg/unapply-implicit-arg3.check @@ -1,15 +1,15 @@ -- Warning: tests/init-global/neg/unapply-implicit-arg3.scala:4:25 ----------------------------------------------------- 4 | def m2(i: Int) = i + i2 | ^^ - | Access uninitialized field value i2. Call trace: - | -> object Bar { [ unapply-implicit-arg3.scala:1 ] - | ^ - | -> case Bar(i) => i [ unapply-implicit-arg3.scala:12 ] - | ^^^^^^ - | -> def unapply(using f1: Foo)(i: Int): Option[Int] = [ unapply-implicit-arg3.scala:6 ] - | ^ - | -> if i == 0 then Some(f1.m1(i)) else Some(f1.m2(i)) [ unapply-implicit-arg3.scala:7 ] - | ^^^^^^^^ - | -> def m2(i: Int) = i + i2 [ unapply-implicit-arg3.scala:4 ] - | ^^ + | Access uninitialized field value i2. Calling trace: + | ├── object Bar { [ unapply-implicit-arg3.scala:1 ] + | │ ^ + | ├── case Bar(i) => i [ unapply-implicit-arg3.scala:12 ] + | │ ^^^^^^ + | ├── def unapply(using f1: Foo)(i: Int): Option[Int] = [ unapply-implicit-arg3.scala:6 ] + | │ ^ + | ├── if i == 0 then Some(f1.m1(i)) else Some(f1.m2(i)) [ unapply-implicit-arg3.scala:7 ] + | │ ^^^^^^^^ + | └── def m2(i: Int) = i + i2 [ unapply-implicit-arg3.scala:4 ] + | ^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/unapplySeq-implicit-arg.check b/tests/init-global/neg/unapplySeq-implicit-arg.check index 869d0b38f2f6..d021cd1f5d94 100644 --- a/tests/init-global/neg/unapplySeq-implicit-arg.check +++ b/tests/init-global/neg/unapplySeq-implicit-arg.check @@ -1,9 +1,9 @@ -- Warning: tests/init-global/neg/unapplySeq-implicit-arg.scala:11:20 -------------------------------------------------- 11 | val i2: Int = Seq(i2) match | ^^ - | Access uninitialized field value i2. Call trace: - | -> object Bar { [ unapplySeq-implicit-arg.scala:1 ] - | ^ - | -> val i2: Int = Seq(i2) match [ unapplySeq-implicit-arg.scala:11 ] - | ^^ + | Access uninitialized field value i2. Calling trace: + | ├── object Bar { [ unapplySeq-implicit-arg.scala:1 ] + | │ ^ + | └── val i2: Int = Seq(i2) match [ unapplySeq-implicit-arg.scala:11 ] + | ^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/unapplySeq-implicit-arg2.check b/tests/init-global/neg/unapplySeq-implicit-arg2.check index bda9e4266f3c..2e5164d7b405 100644 --- a/tests/init-global/neg/unapplySeq-implicit-arg2.check +++ b/tests/init-global/neg/unapplySeq-implicit-arg2.check @@ -1,13 +1,13 @@ -- Warning: tests/init-global/neg/unapplySeq-implicit-arg2.scala:4:9 --------------------------------------------------- 4 | Some(i1 +: seqi) | ^^ - |Access uninitialized field value i1. Call trace: - |-> object Bar { [ unapplySeq-implicit-arg2.scala:1 ] - | ^ - |-> case Bar(i) => i [ unapplySeq-implicit-arg2.scala:7 ] - | ^^^^^^ - |-> def unapplySeq(using f1: Foo)(using f2: Foo)(seqi: Seq[Int])(using Foo): Option[Seq[Int]] = [ unapplySeq-implicit-arg2.scala:3 ] - | ^ - |-> Some(i1 +: seqi) [ unapplySeq-implicit-arg2.scala:4 ] - | ^^ + |Access uninitialized field value i1. Calling trace: + |├── object Bar { [ unapplySeq-implicit-arg2.scala:1 ] + |│ ^ + |├── case Bar(i) => i [ unapplySeq-implicit-arg2.scala:7 ] + |│ ^^^^^^ + |├── def unapplySeq(using f1: Foo)(using f2: Foo)(seqi: Seq[Int])(using Foo): Option[Seq[Int]] = [ unapplySeq-implicit-arg2.scala:3 ] + |│ ^ + |└── Some(i1 +: seqi) [ unapplySeq-implicit-arg2.scala:4 ] + | ^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/unapplySeq-implicit-arg3.check b/tests/init-global/neg/unapplySeq-implicit-arg3.check index abf11f0bafec..59ea56320452 100644 --- a/tests/init-global/neg/unapplySeq-implicit-arg3.check +++ b/tests/init-global/neg/unapplySeq-implicit-arg3.check @@ -1,15 +1,15 @@ -- Warning: tests/init-global/neg/unapplySeq-implicit-arg3.scala:3:27 -------------------------------------------------- 3 | def m(seq: Seq[Int]) = i1 +: seq | ^^ - |Access uninitialized field value i1. Call trace: - |-> object Bar { [ unapplySeq-implicit-arg3.scala:1 ] - | ^ - |-> case Bar(i, _) => i [ unapplySeq-implicit-arg3.scala:9 ] - | ^^^^^^^^^ - |-> def unapplySeq(using f1: Foo)(seqi: Seq[Int])(using Foo): Option[Seq[Int]] = [ unapplySeq-implicit-arg3.scala:5 ] - | ^ - |-> Some(f1.m(seqi)) [ unapplySeq-implicit-arg3.scala:6 ] - | ^^^^^^^^^^ - |-> def m(seq: Seq[Int]) = i1 +: seq [ unapplySeq-implicit-arg3.scala:3 ] - | ^^ + |Access uninitialized field value i1. Calling trace: + |├── object Bar { [ unapplySeq-implicit-arg3.scala:1 ] + |│ ^ + |├── case Bar(i, _) => i [ unapplySeq-implicit-arg3.scala:9 ] + |│ ^^^^^^^^^ + |├── def unapplySeq(using f1: Foo)(seqi: Seq[Int])(using Foo): Option[Seq[Int]] = [ unapplySeq-implicit-arg3.scala:5 ] + |│ ^ + |├── Some(f1.m(seqi)) [ unapplySeq-implicit-arg3.scala:6 ] + |│ ^^^^^^^^^^ + |└── def m(seq: Seq[Int]) = i1 +: seq [ unapplySeq-implicit-arg3.scala:3 ] + | ^^ No warnings can be incurred under -Werror. diff --git a/tests/init-global/neg/i18628.scala b/tests/init-global/warn/i18628.scala similarity index 69% rename from tests/init-global/neg/i18628.scala rename to tests/init-global/warn/i18628.scala index 798b3204338c..afd5c14d0b7d 100644 --- a/tests/init-global/neg/i18628.scala +++ b/tests/init-global/warn/i18628.scala @@ -2,6 +2,6 @@ object Test: class Box(val x: Int) def recur(a: => Box, b: => Box): Int = - a.x + recur(a, b) + b.x // error // error + a.x + recur(a, b) + b.x // warn // warn recur(Box(1), Box(2)) \ No newline at end of file diff --git a/tests/init-global/neg/i18628_2.scala b/tests/init-global/warn/i18628_2.scala similarity index 73% rename from tests/init-global/neg/i18628_2.scala rename to tests/init-global/warn/i18628_2.scala index 4ad428035441..7f90f51ccc1a 100644 --- a/tests/init-global/neg/i18628_2.scala +++ b/tests/init-global/warn/i18628_2.scala @@ -2,6 +2,6 @@ object Test: class Box(val x: Int) def recur(a: => Box, b: Box): Int = - a.x + recur(a, b) + b.x // error + a.x + recur(a, b) + b.x // warn recur(Box(1), Box(2)) diff --git a/tests/init-global/neg/i18628_3.scala b/tests/init-global/warn/i18628_3.scala similarity index 67% rename from tests/init-global/neg/i18628_3.scala rename to tests/init-global/warn/i18628_3.scala index 101674cffb6f..0a14c7d4c73e 100644 --- a/tests/init-global/neg/i18628_3.scala +++ b/tests/init-global/warn/i18628_3.scala @@ -4,6 +4,6 @@ object Test: class Box(val x: Int) def recur(a: => Box, b: => Box): Int = - a.x + recur(a: @widen(5), b: @widen(5)) + b.x // error // error + a.x + recur(a: @widen(5), b: @widen(5)) + b.x // warn // warn recur(Box(1), Box(2)) \ No newline at end of file diff --git a/tests/init/neg/secondary-ctor4.check b/tests/init/warn/secondary-ctor4.check similarity index 84% rename from tests/init/neg/secondary-ctor4.check rename to tests/init/warn/secondary-ctor4.check index 2c89cfe9f289..3909af5ac336 100644 --- a/tests/init/neg/secondary-ctor4.check +++ b/tests/init/warn/secondary-ctor4.check @@ -1,10 +1,10 @@ --- Error: tests/init/neg/secondary-ctor4.scala:54:14 ------------------------------------------------------------------- -54 | val c = new C(b, 5) // error +-- Warning: tests/init/warn/secondary-ctor4.scala:54:14 ---------------------------------------------------------------- +54 | val c = new C(b, 5) // warn | ^^^^^^^^^^^ | Problematic object instantiation: arg 1 is not transitively initialized (Hot). Calling trace: | ├── class D { [ secondary-ctor4.scala:52 ] | │ ^ - | └── val c = new C(b, 5) // error [ secondary-ctor4.scala:54 ] + | └── val c = new C(b, 5) // warn [ secondary-ctor4.scala:54 ] | ^^^^^^^^^^^ | | It leads to the following error during object initialization: @@ -21,15 +21,15 @@ | │ ^ | └── println(b.n) [ secondary-ctor4.scala:23 ] | ^^^ --- Error: tests/init/neg/secondary-ctor4.scala:42:4 -------------------------------------------------------------------- -42 | new A(new B(new D)) // error +-- Warning: tests/init/warn/secondary-ctor4.scala:42:4 ----------------------------------------------------------------- +42 | new A(new B(new D)) // warn | ^^^^^^^^^^^^^^^^^^^ |Problematic object instantiation: the outer M.this and arg 1 are not transitively initialized (Hot). Calling trace: |├── class N(d: D) extends M(d) { [ secondary-ctor4.scala:59 ] |│ ^ |├── def this(d: D) = { [ secondary-ctor4.scala:7 ] |│ ^ - |└── new A(new B(new D)) // error [ secondary-ctor4.scala:42 ] + |└── new A(new B(new D)) // warn [ secondary-ctor4.scala:42 ] | ^^^^^^^^^^^^^^^^^^^ | |It leads to the following error during object initialization: diff --git a/tests/init/neg/secondary-ctor4.scala b/tests/init/warn/secondary-ctor4.scala similarity index 90% rename from tests/init/neg/secondary-ctor4.scala rename to tests/init/warn/secondary-ctor4.scala index e80630002638..9c53034ee597 100644 --- a/tests/init/neg/secondary-ctor4.scala +++ b/tests/init/warn/secondary-ctor4.scala @@ -10,7 +10,7 @@ class M(x: Int) { class L1(x: Int) { val n: Int = 5 } class A(b: B, x: Int) { - println(d.n) + println(d.n) class L2(x: Int) { val n: Int = 5 } @@ -39,7 +39,7 @@ class M(x: Int) { val n: Int = 10 } - new A(new B(new D)) // error + new A(new B(new D)) // warn trait T { val m: Int = 10 @@ -51,7 +51,7 @@ class M(x: Int) { class D { val b = new B(this) - val c = new C(b, 5) // error + val c = new C(b, 5) // warn } } } diff --git a/tests/init/neg/trait1.scala b/tests/init/warn/trait1.scala similarity index 79% rename from tests/init/neg/trait1.scala rename to tests/init/warn/trait1.scala index 48eae248fee7..d5c30569c4ee 100644 --- a/tests/init/neg/trait1.scala +++ b/tests/init/warn/trait1.scala @@ -3,7 +3,7 @@ abstract class A(x: Int) { foo() } -trait B(val y: Int) // error +trait B(val y: Int) // warn class C extends A(10) with B(20) { def foo(): Unit = println(y) diff --git a/tests/init/neg/trait2.scala b/tests/init/warn/trait2.scala similarity index 83% rename from tests/init/neg/trait2.scala rename to tests/init/warn/trait2.scala index 6011c259b73f..1b5bfded5730 100644 --- a/tests/init/neg/trait2.scala +++ b/tests/init/warn/trait2.scala @@ -3,7 +3,7 @@ abstract class A(x: Int) { foo() } -trait B(val y: Int) // error +trait B(val y: Int) // warn class D { class C extends A(10) with B(20) { diff --git a/tests/neg-custom-args/sourcepath2/hi/A.check b/tests/neg-custom-args/sourcepath2/hi/A.check index 61d4798a34e7..1fac6b1147ef 100644 --- a/tests/neg-custom-args/sourcepath2/hi/A.check +++ b/tests/neg-custom-args/sourcepath2/hi/A.check @@ -1,6 +1,7 @@ --- Error: tests/neg-custom-args/sourcepath2/hi/A.scala:3:6 ------------------------------------------------------------- -3 |class Hello { // error +-- Warning: tests/neg-custom-args/sourcepath2/hi/A.scala:3:6 ----------------------------------------------------------- +3 |class Hello { // warn | ^ | class Hello is in the wrong directory. | It was declared to be in package | But it is found in directory hi +No warnings can be incurred under -Werror. diff --git a/tests/neg-custom-args/sourcepath2/hi/A.scala b/tests/neg-custom-args/sourcepath2/hi/A.scala index c332f2494e15..039910e55ce7 100644 --- a/tests/neg-custom-args/sourcepath2/hi/A.scala +++ b/tests/neg-custom-args/sourcepath2/hi/A.scala @@ -1,5 +1,6 @@ // Missing `package hi` -class Hello { // error +class Hello { // warn val x: Int = 1 } +// nopos-error: werror \ No newline at end of file diff --git a/tests/neg/filtering-fors.scala b/tests/neg/filtering-fors.scala index ef6d7790ce7e..7d998a37f057 100644 --- a/tests/neg/filtering-fors.scala +++ b/tests/neg/filtering-fors.scala @@ -8,18 +8,18 @@ object Test { for (x: Any <- xs) do () // OK for (x: String <- xs) do () // error - for ((x: String) <- xs) do () // warn - for (y@ (x: String) <- xs) do () // warn - for ((x, y) <- xs) do () // warn + for ((x: String) <- xs) do () // error + for (y@ (x: String) <- xs) do () // error + for ((x, y) <- xs) do () // error - for ((x: String) <- xs if x.isEmpty) do () // warn - for ((x: String) <- xs; y = x) do () // warn - for ((x: String) <- xs; (y, z) <- xs) do () // warn // warn - for (case (x: String) <- xs; (y, z) <- xs) do () // warn - for ((x: String) <- xs; case (y, z) <- xs) do () // warn + for ((x: String) <- xs if x.isEmpty) do () // error + for ((x: String) <- xs; y = x) do () // error + for ((x: String) <- xs; (y, z) <- xs) do () // error // error + for (case (x: String) <- xs; (y, z) <- xs) do () // error + for ((x: String) <- xs; case (y, z) <- xs) do () // error val pairs: List[AnyRef] = List((1, 2), "hello", (3, 4)) - for ((x, y) <- pairs) yield (y, x) // warn + for ((x, y) <- pairs) yield (y, x) // error for (case x: String <- xs) do () // OK for (case (x: String) <- xs) do () // OK @@ -31,5 +31,4 @@ object Test { for (case (x: String) <- xs; case (y, z) <- xs) do () // OK for (case (x, y) <- pairs) yield (y, x) // OK -} -// nopos-error: No warnings can be incurred under -Werror. \ No newline at end of file +} \ No newline at end of file diff --git a/tests/neg/i11225b.check b/tests/neg/i11225b.check new file mode 100644 index 000000000000..12ec80515e6f --- /dev/null +++ b/tests/neg/i11225b.check @@ -0,0 +1,6 @@ +-- Error: tests/neg/i11225b.scala:6:26 --------------------------------------------------------------------------------- +6 | private var cached: A = _ // error + | ^ + | `= _` has been deprecated; use `= uninitialized` instead. + | `uninitialized` can be imported with `scala.compiletime.uninitialized`. + | This construct can be rewritten automatically under -rewrite -source 3.4-migration. diff --git a/tests/warn/i11225b.scala b/tests/neg/i11225b.scala similarity index 68% rename from tests/warn/i11225b.scala rename to tests/neg/i11225b.scala index ad4e747fdc86..c2b94571e06c 100644 --- a/tests/warn/i11225b.scala +++ b/tests/neg/i11225b.scala @@ -1,9 +1,9 @@ -//> using options -source future -deprecation +//> using options -source future -deprecation import compiletime.uninitialized class Memo[A](x: => A): - private var cached: A = _ // warn + private var cached: A = _ // error private var known: Boolean = false def force = if !known then diff --git a/tests/neg/i18862-3.4.scala b/tests/neg/i18862-3.4.scala deleted file mode 100644 index a30c8c8f1a59..000000000000 --- a/tests/neg/i18862-3.4.scala +++ /dev/null @@ -1,6 +0,0 @@ -//> using options -Werror - -import scala.language.`3.4` - -def f(x: Int*): Unit = () -def test(xs: List[Int]): Unit = f(xs: _*) // error: migration warning diff --git a/tests/neg/i18862-future-migration.scala b/tests/neg/i18862-future-migration.scala deleted file mode 100644 index ff8ba1c377c3..000000000000 --- a/tests/neg/i18862-future-migration.scala +++ /dev/null @@ -1,6 +0,0 @@ -//> using options -Werror - -import scala.language.`future-migration` - -def f(x: Int*): Unit = () -def test(xs: List[Int]): Unit = f(xs: _*) // error: migration warning diff --git a/tests/neg/i18867-3.4.scala b/tests/neg/i18867-3.4.scala deleted file mode 100644 index c5fd2976c8b0..000000000000 --- a/tests/neg/i18867-3.4.scala +++ /dev/null @@ -1,7 +0,0 @@ -//> using options -Werror - -import language.`3.4` - -def foo(x: Int) = x - -def test = foo _ // error diff --git a/tests/neg/i18867.scala b/tests/neg/i18867.scala deleted file mode 100644 index 722347a613f5..000000000000 --- a/tests/neg/i18867.scala +++ /dev/null @@ -1,5 +0,0 @@ -//> using options -Werror - -def foo(x: Int) = x - -def test = foo _ // error diff --git a/tests/neg/infix.check b/tests/neg/infix.check new file mode 100644 index 000000000000..7c7c87005291 --- /dev/null +++ b/tests/neg/infix.check @@ -0,0 +1,30 @@ +-- Error: tests/neg/infix.scala:26:4 ----------------------------------------------------------------------------------- +26 | c mop 2 // error: should not be used as infix operator + | ^^^ + | Alphanumeric method mop is not declared infix; it should not be used as infix operator. + | Instead, use method syntax .mop(...) or backticked identifier `mop`. + | The latter can be rewritten automatically under -rewrite -source future-migration. +-- Error: tests/neg/infix.scala:27:4 ----------------------------------------------------------------------------------- +27 | c meth 2 // error: should not be used as infix operator + | ^^^^ + | Alphanumeric method meth is not declared infix; it should not be used as infix operator. + | Instead, use method syntax .meth(...) or backticked identifier `meth`. + | The latter can be rewritten automatically under -rewrite -source future-migration. +-- Error: tests/neg/infix.scala:45:14 ---------------------------------------------------------------------------------- +45 | val x1: Int Map String = ??? // error + | ^^^ + | Alphanumeric type Map is not declared infix; it should not be used as infix operator. + | Instead, use prefix syntax Map[...] or backticked identifier `Map`. + | The latter can be rewritten automatically under -rewrite -source future-migration. +-- Error: tests/neg/infix.scala:47:14 ---------------------------------------------------------------------------------- +47 | val x3: Int AndC String = ??? // error + | ^^^^ + | Alphanumeric type AndC is not declared infix; it should not be used as infix operator. + | Instead, use prefix syntax AndC[...] or backticked identifier `AndC`. + | The latter can be rewritten automatically under -rewrite -source future-migration. +-- Error: tests/neg/infix.scala:61:8 ----------------------------------------------------------------------------------- +61 | val _ Pair _ = p // error + | ^^^^ + | Alphanumeric extractor Pair is not declared infix; it should not be used as infix operator. + | Instead, use prefix syntax Pair(...) or backticked identifier `Pair`. + | The latter can be rewritten automatically under -rewrite -source future-migration. diff --git a/tests/warn/infix.scala b/tests/neg/infix.scala similarity index 82% rename from tests/warn/infix.scala rename to tests/neg/infix.scala index 6494df970e3f..dda638c829f9 100644 --- a/tests/warn/infix.scala +++ b/tests/neg/infix.scala @@ -1,4 +1,4 @@ -//> using options -source future -deprecation +//> using options -source future -deprecation // Compile with -strict -Xfatal-warnings -deprecation class C: @@ -23,8 +23,8 @@ def test() = { c.op(2) c.iop(2) - c mop 2 // warn: should not be used as infix operator - c meth 2 // warn: should not be used as infix operator + c mop 2 // error: should not be used as infix operator + c meth 2 // error: should not be used as infix operator c `meth` 2 // OK, sincd `meth` is backquoted c + 3 // OK, since `+` is symbolic 1 to 2 // OK, since `to` is defined by Scala-2 @@ -42,9 +42,9 @@ def test() = { class Map[X, Y] - val x1: Int Map String = ??? // warn + val x1: Int Map String = ??? // error val x2: Int Or String = ??? // OK since Or is declared `infix` - val x3: Int AndC String = ??? // warn + val x3: Int AndC String = ??? // error val x4: Int `AndC` String = ??? // OK val x5: Int And String = ??? // OK val x6: Int && String = ??? @@ -58,7 +58,7 @@ def test() = { val p = Pair(1, 2) val Pair(_, _) = p - val _ Pair _ = p // warn + val _ Pair _ = p // error val _ `Pair` _ = p // OK val (_ PP _) = p: @unchecked // OK diff --git a/tests/neg/private-this-3.4.scala b/tests/neg/private-this-3.4.scala deleted file mode 100644 index b198e954e41b..000000000000 --- a/tests/neg/private-this-3.4.scala +++ /dev/null @@ -1,7 +0,0 @@ -//> using options -Werror - -import scala.language.`3.4` - -class Foo: - private[this] def foo: Int = ??? // error: migration warning - protected[this] def bar: Int = ??? // error: migration warning diff --git a/tests/neg/private-this-future-migration.scala b/tests/neg/private-this-future-migration.scala deleted file mode 100644 index 7e3da2be72e2..000000000000 --- a/tests/neg/private-this-future-migration.scala +++ /dev/null @@ -1,7 +0,0 @@ -//> using options -Werror - -import scala.language.`future-migration` - -class Foo: - private[this] def foo: Int = ??? // error: migration warning - protected[this] def bar: Int = ??? // error: migration warning diff --git a/tests/warn/refutable-pattern-binding-messages.check b/tests/neg/refutable-pattern-binding-messages.check similarity index 65% rename from tests/warn/refutable-pattern-binding-messages.check rename to tests/neg/refutable-pattern-binding-messages.check index f3c3adb7835e..4a8f895264a3 100644 --- a/tests/warn/refutable-pattern-binding-messages.check +++ b/tests/neg/refutable-pattern-binding-messages.check @@ -1,19 +1,12 @@ --- Warning: tests/warn/refutable-pattern-binding-messages.scala:5:14 --------------------------------------------------- -5 | val Positive(p) = 5 // warn: refutable extractor - | ^^^^^^^^^^^^^^^ - | pattern binding uses refutable extractor `Test.Positive` - | - | If this usage is intentional, this can be communicated by adding `: @unchecked` after the expression, - | which may result in a MatchError at runtime. - | This patch can be rewritten automatically under -rewrite -source 3.2-migration. --- Warning: tests/warn/refutable-pattern-binding-messages.scala:6:14 --------------------------------------------------- -6 | for Positive(i) <- List(1, 2, 3) do () // warn: refutable extractor +-- Error: tests/neg/refutable-pattern-binding-messages.scala:6:14 ------------------------------------------------------ +6 | for Positive(i) <- List(1, 2, 3) do () // error: refutable extractor | ^^^^^^^^^^^ | pattern binding uses refutable extractor `Test.Positive` | | If this usage is intentional, this can be communicated by adding the `case` keyword before the full pattern, | which will result in a filtering for expression (using `withFilter`). | This patch can be rewritten automatically under -rewrite -source 3.2-migration. +-- Error: tests/neg/refutable-pattern-binding-messages.scala:11:11 ----------------------------------------------------- 11 | for ((x: String) <- xs) do () // error: pattern type more specialized | ^^^^^^ | pattern's type String is more specialized than the right hand side expression's type AnyRef @@ -21,32 +14,32 @@ | If the narrowing is intentional, this can be communicated by adding the `case` keyword before the full pattern, | which will result in a filtering for expression (using `withFilter`). | This patch can be rewritten automatically under -rewrite -source 3.2-migration. --- Warning: tests/warn/refutable-pattern-binding-messages.scala:15:13 -------------------------------------------------- -15 | for none @ None <- ys do () // warn: pattern type does not match +-- Error: tests/neg/refutable-pattern-binding-messages.scala:15:13 ----------------------------------------------------- +15 | for none @ None <- ys do () // error: pattern type does not match | ^^^^ | pattern's type None.type does not match the right hand side expression's type (x$1 : Option[?]) | | If the narrowing is intentional, this can be communicated by adding the `case` keyword before the full pattern, | which will result in a filtering for expression (using `withFilter`). | This patch can be rewritten automatically under -rewrite -source 3.2-migration. --- Error: tests/neg/refutable-pattern-binding-messages.scala:5:14 ------------------------------------------------------ -5 | val Positive(p) = 5 // error: refutable extractor +-- Warning: tests/neg/refutable-pattern-binding-messages.scala:5:14 ---------------------------------------------------- +5 | val Positive(p) = 5 // warn: refutable extractor | ^^^^^^^^^^^^^^^ | pattern binding uses refutable extractor `Test.Positive` | | If this usage is intentional, this can be communicated by adding `: @unchecked` after the expression, | which may result in a MatchError at runtime. | This patch can be rewritten automatically under -rewrite -source 3.2-migration. --- Error: tests/neg/refutable-pattern-binding-messages.scala:10:20 ----------------------------------------------------- -10 | val i :: is = List(1, 2, 3) // error: pattern type more specialized +-- Warning: tests/neg/refutable-pattern-binding-messages.scala:10:20 --------------------------------------------------- +10 | val i :: is = List(1, 2, 3) // warn: pattern type more specialized | ^^^^^^^^^^^^^ | pattern's type ::[Int] is more specialized than the right hand side expression's type List[Int] | | If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression, | which may result in a MatchError at runtime. | This patch can be rewritten automatically under -rewrite -source 3.2-migration. --- Error: tests/neg/refutable-pattern-binding-messages.scala:16:10 ----------------------------------------------------- -16 | val 1 = 2 // error: pattern type does not match +-- Warning: tests/neg/refutable-pattern-binding-messages.scala:16:10 --------------------------------------------------- +16 | val 1 = 2 // warn: pattern type does not match | ^ | pattern's type (1 : Int) does not match the right hand side expression's type (2 : Int) | diff --git a/tests/warn/refutable-pattern-binding-messages.scala b/tests/neg/refutable-pattern-binding-messages.scala similarity index 65% rename from tests/warn/refutable-pattern-binding-messages.scala rename to tests/neg/refutable-pattern-binding-messages.scala index 41aa24787389..e71371785d15 100644 --- a/tests/warn/refutable-pattern-binding-messages.scala +++ b/tests/neg/refutable-pattern-binding-messages.scala @@ -3,15 +3,15 @@ object Test { // refutable extractor object Positive { def unapply(i: Int): Option[Int] = Some(i).filter(_ > 0) } val Positive(p) = 5 // warn: refutable extractor - for Positive(i) <- List(1, 2, 3) do () // warn: refutable extractor + for Positive(i) <- List(1, 2, 3) do () // error: refutable extractor // more specialized val xs: List[AnyRef] = ??? val i :: is = List(1, 2, 3) // warn: pattern type more specialized - for ((x: String) <- xs) do () // warn: pattern type more specialized + for ((x: String) <- xs) do () // error: pattern type more specialized // does not match val ys: List[Option[?]] = ??? - for none @ None <- ys do () // warn: pattern type does not match + for none @ None <- ys do () // error: pattern type does not match val 1 = 2 // warn: pattern type does not match -} \ No newline at end of file +} diff --git a/tests/neg/i18862-3.4.check b/tests/warn/i18862-3.4.check similarity index 70% rename from tests/neg/i18862-3.4.check rename to tests/warn/i18862-3.4.check index b56454feeeaa..8dd5058d305e 100644 --- a/tests/neg/i18862-3.4.check +++ b/tests/warn/i18862-3.4.check @@ -1,5 +1,5 @@ --- Error: tests/neg/i18862-3.4.scala:6:38 ------------------------------------------------------------------------------ -6 |def test(xs: List[Int]): Unit = f(xs: _*) // error: migration warning +-- Warning: tests/warn/i18862-3.4.scala:4:38 --------------------------------------------------------------------------- +4 |def test(xs: List[Int]): Unit = f(xs: _*) // warn: migration warning | ^ | The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead | This construct can be rewritten automatically under -rewrite -source 3.4-migration. diff --git a/tests/warn/i18862-3.4.scala b/tests/warn/i18862-3.4.scala new file mode 100644 index 000000000000..6d9cf8c71f7b --- /dev/null +++ b/tests/warn/i18862-3.4.scala @@ -0,0 +1,4 @@ +import scala.language.`3.4` + +def f(x: Int*): Unit = () +def test(xs: List[Int]): Unit = f(xs: _*) // warn: migration warning diff --git a/tests/warn/i18862-future-migration.scala b/tests/warn/i18862-future-migration.scala new file mode 100644 index 000000000000..02225b67435a --- /dev/null +++ b/tests/warn/i18862-future-migration.scala @@ -0,0 +1,4 @@ +import scala.language.`future-migration` + +def f(x: Int*): Unit = () +def test(xs: List[Int]): Unit = f(xs: _*) // warn: migration warning diff --git a/tests/warn/i18867-3.4.scala b/tests/warn/i18867-3.4.scala new file mode 100644 index 000000000000..e2630c0cb95c --- /dev/null +++ b/tests/warn/i18867-3.4.scala @@ -0,0 +1,5 @@ +import language.`3.4` + +def foo(x: Int) = x + +def test = foo _ // warn diff --git a/tests/neg/i18867.check b/tests/warn/i18867.check similarity index 76% rename from tests/neg/i18867.check rename to tests/warn/i18867.check index 014e9e7bd92e..226496d8e74b 100644 --- a/tests/neg/i18867.check +++ b/tests/warn/i18867.check @@ -1,5 +1,5 @@ --- Error: tests/neg/i18867.scala:5:15 ---------------------------------------------------------------------------------- -5 |def test = foo _ // error +-- Warning: tests/warn/i18867.scala:3:15 ------------------------------------------------------------------------------- +3 |def test = foo _ // warn | ^^^^^ | The syntax ` _` is no longer supported; | you can simply leave out the trailing ` _` diff --git a/tests/warn/i18867.scala b/tests/warn/i18867.scala new file mode 100644 index 000000000000..a16d67b89919 --- /dev/null +++ b/tests/warn/i18867.scala @@ -0,0 +1,3 @@ +def foo(x: Int) = x + +def test = foo _ // warn diff --git a/tests/neg/private-this-3.4.check b/tests/warn/private-this-3.4.check similarity index 74% rename from tests/neg/private-this-3.4.check rename to tests/warn/private-this-3.4.check index 29c2fe909ede..29cdcfac6477 100644 --- a/tests/neg/private-this-3.4.check +++ b/tests/warn/private-this-3.4.check @@ -1,11 +1,11 @@ --- Error: tests/neg/private-this-3.4.scala:6:16 ------------------------------------------------------------------------ -6 | private[this] def foo: Int = ??? // error: migration warning +-- Warning: tests/warn/private-this-3.4.scala:4:16 --------------------------------------------------------------------- +4 | private[this] def foo: Int = ??? // warn: migration warning | ^ | The [this] qualifier will be deprecated in the future; it should be dropped. | See: https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html | This construct can be rewritten automatically under -rewrite -source 3.4-migration. --- Error: tests/neg/private-this-3.4.scala:7:18 ------------------------------------------------------------------------ -7 | protected[this] def bar: Int = ??? // error: migration warning +-- Warning: tests/warn/private-this-3.4.scala:5:18 --------------------------------------------------------------------- +5 | protected[this] def bar: Int = ??? // warn: migration warning | ^ | The [this] qualifier will be deprecated in the future; it should be dropped. | See: https://docs.scala-lang.org/scala3/reference/dropped-features/this-qualifier.html diff --git a/tests/warn/private-this-3.4.scala b/tests/warn/private-this-3.4.scala new file mode 100644 index 000000000000..1270eba116bc --- /dev/null +++ b/tests/warn/private-this-3.4.scala @@ -0,0 +1,5 @@ +import scala.language.`3.4` + +class Foo: + private[this] def foo: Int = ??? // warn: migration warning + protected[this] def bar: Int = ??? // warn: migration warning diff --git a/tests/warn/private-this-future-migration.scala b/tests/warn/private-this-future-migration.scala new file mode 100644 index 000000000000..d719187e534a --- /dev/null +++ b/tests/warn/private-this-future-migration.scala @@ -0,0 +1,5 @@ +import scala.language.`future-migration` + +class Foo: + private[this] def foo: Int = ??? // warn: migration warning + protected[this] def bar: Int = ??? // warn: migration warning diff --git a/tests/warn/rewrite-messages.check b/tests/warn/rewrite-messages.check index f982e35cfdd9..db97d2ed908a 100644 --- a/tests/warn/rewrite-messages.check +++ b/tests/warn/rewrite-messages.check @@ -3,7 +3,7 @@ | ^ | `_` is no longer supported for a wildcard import; use `*` instead | This construct can be rewritten automatically under -rewrite -source future-migration. --- Deprecation Warning: tests/warn/rewrite-messages.scala:7:4 ---------------------------------------------------------- +-- Migration Warning: tests/warn/rewrite-messages.scala:7:4 ------------------------------------------------------------ 7 | 2 foo 4 // warn | ^^^ | Alphanumeric method foo is not declared infix; it should not be used as infix operator. diff --git a/tests/neg/uninitialized-3.4.check b/tests/warn/uninitialized-3.4.check similarity index 75% rename from tests/neg/uninitialized-3.4.check rename to tests/warn/uninitialized-3.4.check index 1c7b985072d0..ddf4bfed85ed 100644 --- a/tests/neg/uninitialized-3.4.check +++ b/tests/warn/uninitialized-3.4.check @@ -1,5 +1,5 @@ --- Error: tests/neg/uninitialized-3.4.scala:7:15 ----------------------------------------------------------------------- -7 | var a: Int = _ // error: migration warning +-- Warning: tests/warn/uninitialized-3.4.scala:5:15 -------------------------------------------------------------------- +5 | var a: Int = _ // warn | ^ | `= _` has been deprecated; use `= uninitialized` instead. | `uninitialized` can be imported with `scala.compiletime.uninitialized`. diff --git a/tests/neg/uninitialized-3.4.scala b/tests/warn/uninitialized-3.4.scala similarity index 60% rename from tests/neg/uninitialized-3.4.scala rename to tests/warn/uninitialized-3.4.scala index 174a95ae6c54..966f2e51af1c 100644 --- a/tests/neg/uninitialized-3.4.scala +++ b/tests/warn/uninitialized-3.4.scala @@ -1,8 +1,6 @@ -//> using options -Werror - import scala.language.`3.4` import scala.compiletime.uninitialized class Foo: - var a: Int = _ // error: migration warning + var a: Int = _ // warn var b: Int = uninitialized diff --git a/tests/neg/uninitialized-future-migration.scala b/tests/warn/uninitialized-future-migration.scala similarity index 62% rename from tests/neg/uninitialized-future-migration.scala rename to tests/warn/uninitialized-future-migration.scala index 05f7c6b67f38..7c24f2466221 100644 --- a/tests/neg/uninitialized-future-migration.scala +++ b/tests/warn/uninitialized-future-migration.scala @@ -1,8 +1,6 @@ -//> using options -Werror - import scala.language.`future-migration` import scala.compiletime.uninitialized class Foo: - var a: Int = _ // error: migration warning + var a: Int = _ // warn: migration warning var b: Int = uninitialized diff --git a/tests/neg/wildcard-type-syntax-3.4.scala b/tests/warn/wildcard-type-syntax-3.4.scala similarity index 52% rename from tests/neg/wildcard-type-syntax-3.4.scala rename to tests/warn/wildcard-type-syntax-3.4.scala index 1123c9cbbe35..2dd280259ac5 100644 --- a/tests/neg/wildcard-type-syntax-3.4.scala +++ b/tests/warn/wildcard-type-syntax-3.4.scala @@ -1,8 +1,6 @@ -//> using options -Werror - import scala.language.`3.4-migration` def test = Seq() match - case _: List[_] => // error: migration warning + case _: List[_] => // warn: migration warning case _: Seq[?] => diff --git a/tests/neg/wildcard-type-syntax-future-migration.scala b/tests/warn/wildcard-type-syntax-future-migration.scala similarity index 53% rename from tests/neg/wildcard-type-syntax-future-migration.scala rename to tests/warn/wildcard-type-syntax-future-migration.scala index 6a5367385ab0..1c55827adb90 100644 --- a/tests/neg/wildcard-type-syntax-future-migration.scala +++ b/tests/warn/wildcard-type-syntax-future-migration.scala @@ -1,8 +1,6 @@ -//> using options -Werror - import scala.language.`future-migration` def test = Seq() match - case _: List[_] => // error: migration warning + case _: List[_] => // warn: migration warning case _: Seq[?] =>