Skip to content

Commit 18f66eb

Browse files
committed
Fix soundness test
1 parent fb73c3f commit 18f66eb

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

tests/init/neg/soundness1.scala

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
class A(b: B) {
2-
val b2 = new B(this) // error
2+
val b2 = new B(this)
33
}
44

55
class B(a: A) {
6-
val a2 = new A(this) // error
6+
val a2 = new A(this)
77
}
8+
9+
object Test2:
10+
class A(b: B) {
11+
val b2 = new B(this)
12+
val c = b2.a2
13+
}
14+
15+
class B(a: A) {
16+
val a2 = new A(this)
17+
val c = a2.b2
18+
}
19+
20+
object Test3:
21+
class A(b: B) {
22+
println(b.a2) // error
23+
val b2 = new B(this)
24+
}
25+
26+
class B(a: A) {
27+
println(a.b2) // error
28+
val a2 = new A(this)
29+
}

tests/init/neg/soundness2.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
class C(c: C) {
2-
val c2 = new C(this) // error
2+
val d = c.c2 // error
3+
val c2 = new C(this)
34
}

0 commit comments

Comments
 (0)