Skip to content

Commit a452a73

Browse files
committed
Moved tests
1 parent 363d3b5 commit a452a73

File tree

109 files changed

+117
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+117
-168
lines changed

tests/init-global/neg/global-cycle1.scala

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/init-global/neg/global-cycle2.scala

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/init-global/neg/global-cycle3.scala

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/init-global/neg/global-irrelevance1.scala

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/init-global/neg/global-irrelevance2.scala

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/init-global/neg/global-irrelevance5.scala

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/init-global/neg/global-list.scala

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/init-global/neg/i11262.scala

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/init-global/neg/t9261.scala

Lines changed: 0 additions & 5 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
-- Warning: tests/init-global/neg/context-sensitivity.scala:9:21 -------------------------------------------------------
2-
9 | def foo(): Int = A.m
1+
-- Warning: tests/init-global/warn/context-sensitivity.scala:9:21 ------------------------------------------------------
2+
9 | def foo(): Int = A.m // warn
33
| ^^^
44
| Access uninitialized field value m. Calling trace:
55
| ├── object A: [ context-sensitivity.scala:14 ]
66
| │ ^
77
| ├── val m: Int = box1.value.foo() [ context-sensitivity.scala:17 ]
88
| │ ^^^^^^^^^^^^^^^^
9-
| └── def foo(): Int = A.m [ context-sensitivity.scala:9 ]
9+
| └── def foo(): Int = A.m // warn [ context-sensitivity.scala:9 ]
1010
| ^^^
11-
No warnings can be incurred under -Werror.

tests/init-global/neg/context-sensitivity.scala renamed to tests/init-global/warn/context-sensitivity.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class C(var x: Int) extends Foo {
66
}
77

88
class D(var y: Int) extends Foo {
9-
def foo(): Int = A.m
9+
def foo(): Int = A.m // warn
1010
}
1111

1212
class Box(var value: Foo)
@@ -16,4 +16,3 @@ object A:
1616
val box2: Box = new Box(new D(10))
1717
val m: Int = box1.value.foo()
1818

19-
// nopos-error: No warnings can be incurred under -Werror.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
object A {
2+
val a: Int = B.b
3+
}
4+
5+
object B {
6+
val b: Int = A.a
7+
}
8+
9+
@main
10+
def Test = print(A.a)
11+

tests/init-global/neg/global-cycle14.scala renamed to tests/init-global/warn/global-cycle14.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ object O {
55
val d = Data(3)
66
}
77

8-
object A {
8+
object A {
99
val n: Int = B.m
1010
}
1111

1212
object B {
13-
val m: Int = A.n
13+
val m: Int = A.n
1414
}
1515

16-
// nopos-error: No warnings can be incurred under -Werror.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
object A {
2+
val a: Int = B.foo()
3+
}
4+
5+
object B {
6+
def foo(): Int = A.a * 2
7+
}
8+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class A(x: Int) {
2+
def foo(): Int = B.a + 10
3+
}
4+
5+
object B {
6+
val a: Int = A(4).foo()
7+
}
8+

tests/init-global/neg/global-cycle4.scala renamed to tests/init-global/warn/global-cycle4.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class B extends A {
77
}
88

99
class C extends A {
10-
def foo(): Int = O.a + 10
10+
def foo(): Int = O.a + 10
1111
}
1212

1313
class D(x: Int) {
@@ -18,4 +18,3 @@ object O {
1818
val a: Int = D(5).bar().foo()
1919
}
2020

21-
// nopos-error: No warnings can be incurred under -Werror.

tests/init-global/neg/global-cycle5.scala renamed to tests/init-global/warn/global-cycle5.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ object A {
77
}
88

99
object B {
10-
val b: Int = A.a.foo()
10+
val b: Int = A.a.foo()
1111
}
1212

1313
class Y extends X {
@@ -21,4 +21,3 @@ object C {
2121
def main = {
2222
A.a = new Y(); C
2323
}
24-
// nopos-error: No warnings can be incurred under -Werror.

tests/init-global/neg/global-cycle6.scala renamed to tests/init-global/warn/global-cycle6.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
object A {
1+
object A {
22
val n: Int = B.m
33
class Inner {
4-
println(n)
4+
println(n)
55
}
66
}
77

@@ -23,4 +23,3 @@ object O {
2323
val m: Int = 10
2424
}
2525
}
26-
// nopos-error: No warnings can be incurred under -Werror.

tests/init-global/neg/global-cycle7.scala renamed to tests/init-global/warn/global-cycle7.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
object A {
1+
object A {
22
val n: Int = B.m
33
}
44

55
object B {
6-
val m: Int = A.n
6+
val m: Int = A.n
77
}
88

99
abstract class TokensCommon {
@@ -17,4 +17,3 @@ object JavaTokens extends TokensCommon {
1717
final val DOUBLE = 188
1818
}
1919

20-
// nopos-error: No warnings can be incurred under -Werror.

tests/init-global/neg/global-cycle8.scala renamed to tests/init-global/warn/global-cycle8.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class B {
66
val a = new A
77
}
88

9-
object O {
9+
object O {
1010
val n: Int = 10
1111
println(P.m)
1212
}
@@ -19,4 +19,3 @@ object Q {
1919
def bar(b: B) = b.a.foo()
2020
}
2121

22-
// nopos-error: No warnings can be incurred under -Werror.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object A:
2+
var x = 6
3+
4+
object B:
5+
var y = A.x * 2
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
object A:
2+
var x = 6
3+
4+
class B(b: Int):
5+
A.x = b * 2
6+
7+
object B:
8+
new B(10)
9+

tests/init-global/neg/global-irrelevance3.scala renamed to tests/init-global/warn/global-irrelevance3.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ object A:
66
var x = 6
77
new Pair(
88
y => x = y,
9-
(() => x)
9+
(() => x)
1010
)
1111

1212

1313
object B:
1414
var y = A.p.g()
1515

16-
// nopos-error: No warnings can be incurred under -Werror.

tests/init-global/neg/global-irrelevance4.scala renamed to tests/init-global/warn/global-irrelevance4.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ object A:
55
def foo(): Pair =
66
var x = 6
77
new Pair(
8-
(y => x = y),
8+
(y => x = y),
99
() => x
1010
)
1111

1212
object B:
1313
A.p.f(10)
1414

15-
// nopos-error: No warnings can be incurred under -Werror.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
object A:
2+
val array: Array[Int] = new Array(1)
3+
array(0) = 10
4+
5+
object B:
6+
var y = A.array(0) * 2
7+

tests/init-global/neg/global-irrelevance6.scala renamed to tests/init-global/warn/global-irrelevance6.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ object A:
66
val n = array(0).foo() // ok, no crash
77

88
object B:
9-
var y = A.array(0).foo() * 2
9+
var y = A.array(0).foo() * 2
1010

11-
// nopos-error: No warnings can be incurred under -Werror.

tests/init-global/neg/global-irrelevance7.scala renamed to tests/init-global/warn/global-irrelevance7.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ object A:
77
val n = array(0).foo() // ok
88

99
object B:
10-
var y = A.array(0).foo() * 2
10+
var y = A.array(0).foo() * 2
1111

12-
// nopos-error: No warnings can be incurred under -Werror.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
case class Foo(name: String)
2+
3+
object O:
4+
val a = Foo("Apple")
5+
val b = Foo("Banana")
6+
val c = Foo("Cherry")
7+
8+
object Foo:
9+
val all: List[Foo] = List(O.a, O.b, O.c)

tests/init-global/neg/global-local-var.scala renamed to tests/init-global/warn/global-local-var.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ class A(x: Int) {
77
sum += i
88
i += 1
99

10-
B.a + 10 + sum
10+
B.a + 10 + sum
1111
}
1212
}
1313

1414
object B {
1515
val a: Int = A(4).foo()
1616
}
1717

18-
// nopos-error: No warnings can be incurred under -Werror.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
trait B { def foo(): Int }
22
class C(var x: Int) extends B { def foo(): Int = 20 }
3-
class D(var y: Int) extends B { def foo(): Int = A.m }
3+
class D(var y: Int) extends B { def foo(): Int = A.m }
44
class Box(var value: B)
55

66
object A:
77
val box1: Box = new Box(new C(5))
88
val box2: Box = new Box(new D(10))
99
val m: Int = box1.value.foo()
1010

11-
// nopos-error: No warnings can be incurred under -Werror.

tests/init-global/warn/i11262.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
object A { val x: String = B.y }
2+
object B { val y: String = A.x }
3+

tests/init-global/neg/i12544b.scala renamed to tests/init-global/warn/i12544b.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ enum Enum:
22
case Case
33

44
object Enum:
5-
object nested:
5+
object nested:
66
val a: Enum = Case
77

8-
val b: Enum = f(nested.a)
8+
val b: Enum = f(nested.a)
99

1010
def f(e: Enum): Enum = e
1111

1212
@main def main(): Unit = println(Enum.b)
1313

14-
// nopos-error: No warnings can be incurred under -Werror.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Foo(val opposite: Foo)
2-
case object A extends Foo(B)
2+
case object A extends Foo(B)
33
case object B extends Foo(A)
44
object Test {
55
def main(args: Array[String]): Unit = {
@@ -8,4 +8,3 @@ object Test {
88
}
99
}
1010

11-
// nopos-error: No warnings can be incurred under -Werror.

0 commit comments

Comments
 (0)