Skip to content

Commit

Permalink
Fix soundness test
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Jun 9, 2021
1 parent bfaef00 commit c5475b4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
26 changes: 24 additions & 2 deletions tests/init/neg/soundness1.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
class A(b: B) {
val b2 = new B(this) // error
val b2 = new B(this)
}

class B(a: A) {
val a2 = new A(this) // error
val a2 = new A(this)
}

object Test2:
class A(b: B) {
val b2 = new B(this)
val c = b2.a2
}

class B(a: A) {
val a2 = new A(this)
val c = a2.b2
}

object Test3:
class A(b: B) {
println(b.a2) // error
val b2 = new B(this)
}

class B(a: A) {
println(a.b2) // error
val a2 = new A(this)
}
3 changes: 2 additions & 1 deletion tests/init/neg/soundness2.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
class C(c: C) {
val c2 = new C(this) // error
val d = c.c2 // error
val c2 = new C(this)
}

0 comments on commit c5475b4

Please sign in to comment.