-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move rest of the warn tests from neg to warn
- Loading branch information
Showing
128 changed files
with
928 additions
and
427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Warning: tests/init-global/neg/context-sensitivity.scala:9:21 ------------------------------------------------------- | ||
9 | def foo(): Int = A.m | ||
| ^^^ | ||
| 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
-- Error: tests/init-global/neg/global-cycle1.scala:1:7 ---------------------------------------------------------------- | ||
1 |object A { // error | ||
-- Warning: tests/init-global/neg/global-cycle1.scala:1:7 -------------------------------------------------------------- | ||
1 |object A { | ||
| ^ | ||
| Cyclic initialization: object A -> object B -> object A. Calling trace: | ||
| ├── object A { // error [ global-cycle1.scala:1 ] | ||
| ├── object A { [ global-cycle1.scala:1 ] | ||
| │ ^ | ||
| ├── val a: Int = B.b [ global-cycle1.scala:2 ] | ||
| │ ^ | ||
| ├── object B { [ global-cycle1.scala:5 ] | ||
| │ ^ | ||
| └── val b: Int = A.a // error [ global-cycle1.scala:6 ] | ||
| └── val b: Int = A.a [ global-cycle1.scala:6 ] | ||
| ^ | ||
-- Error: tests/init-global/neg/global-cycle1.scala:6:17 --------------------------------------------------------------- | ||
6 | val b: Int = A.a // error | ||
-- Warning: tests/init-global/neg/global-cycle1.scala:6:17 ------------------------------------------------------------- | ||
6 | val b: Int = A.a | ||
| ^^^ | ||
| Access uninitialized field value a. Calling trace: | ||
| ├── object B { [ global-cycle1.scala:5 ] | ||
| │ ^ | ||
| └── val b: Int = A.a // error [ global-cycle1.scala:6 ] | ||
| └── val b: Int = A.a [ global-cycle1.scala:6 ] | ||
| ^^^ | ||
No warnings can be incurred under -Werror. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
object A { // error | ||
object A { | ||
val a: Int = B.b | ||
} | ||
|
||
object B { | ||
val b: Int = A.a // error | ||
val b: Int = A.a | ||
} | ||
|
||
@main | ||
def Test = print(A.a) | ||
|
||
// nopos-error: No warnings can be incurred under -Werror. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- Warning: tests/init-global/neg/global-cycle14.scala:8:7 ------------------------------------------------------------- | ||
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 ] | ||
| ^ | ||
-- Warning: tests/init-global/neg/global-cycle14.scala:13:17 ----------------------------------------------------------- | ||
13 | val m: Int = A.n | ||
| ^^^ | ||
| 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Warning: tests/init-global/neg/global-cycle2.scala:6:21 ------------------------------------------------------------- | ||
6 | def foo(): Int = A.a * 2 | ||
| ^^^ | ||
| 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Warning: tests/init-global/neg/global-cycle3.scala:2:21 ------------------------------------------------------------- | ||
2 | def foo(): Int = B.a + 10 | ||
| ^^^ | ||
| 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
class A(x: Int) { | ||
def foo(): Int = B.a + 10 // error | ||
def foo(): Int = B.a + 10 | ||
} | ||
|
||
object B { | ||
val a: Int = A(4).foo() | ||
} | ||
|
||
// nopos-error: No warnings can be incurred under -Werror. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Warning: tests/init-global/neg/global-cycle4.scala:10:21 ------------------------------------------------------------ | ||
10 | def foo(): Int = O.a + 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- Warning: tests/init-global/neg/global-cycle5.scala:10:17 ------------------------------------------------------------ | ||
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 ] | ||
| ^^^ | ||
No warnings can be incurred under -Werror. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- Warning: tests/init-global/neg/global-cycle6.scala:1:7 -------------------------------------------------------------- | ||
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 ] | ||
| ^ | ||
-- Warning: tests/init-global/neg/global-cycle6.scala:4:12 ------------------------------------------------------------- | ||
4 | println(n) | ||
| ^ | ||
| 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- Warning: tests/init-global/neg/global-cycle7.scala:1:7 -------------------------------------------------------------- | ||
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 ] | ||
| ^ | ||
-- Warning: tests/init-global/neg/global-cycle7.scala:6:17 ------------------------------------------------------------- | ||
6 | val m: Int = A.n | ||
| ^^^ | ||
| 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- Warning: tests/init-global/neg/global-cycle8.scala:9:7 -------------------------------------------------------------- | ||
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 ] | ||
| ^ | ||
No warnings can be incurred under -Werror. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- Warning: tests/init-global/neg/global-irrelevance1.scala:5:12 ------------------------------------------------------- | ||
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 ] | ||
| ^^^ | ||
No warnings can be incurred under -Werror. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.