diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t9946a.scala | 14 | ||||
-rw-r--r-- | test/files/run/t9946b.scala | 12 | ||||
-rw-r--r-- | test/files/run/t9946c.scala | 10 |
3 files changed, 36 insertions, 0 deletions
diff --git a/test/files/run/t9946a.scala b/test/files/run/t9946a.scala new file mode 100644 index 0000000000..491fb31f7b --- /dev/null +++ b/test/files/run/t9946a.scala @@ -0,0 +1,14 @@ +package p1 { + object O { + private case class N(a: Any) + lazy val x: AnyRef = N + lazy val y: AnyRef = new { assert(N != null) } + } +} + +object Test { + def main(args: Array[String]): Unit = { + p1.O.x + p1.O.y + } +} diff --git a/test/files/run/t9946b.scala b/test/files/run/t9946b.scala new file mode 100644 index 0000000000..ac102a38f7 --- /dev/null +++ b/test/files/run/t9946b.scala @@ -0,0 +1,12 @@ +class Test(private val x: String) { + lazy val y = x.reverse +} +object Test { + def getX(t: Test) = t.x + def main(args: Array[String]): Unit = { + val t = new Test("foo") + assert(t.y == "oof", t.y) + assert(t.x == "foo", t.x) + } +} + diff --git a/test/files/run/t9946c.scala b/test/files/run/t9946c.scala new file mode 100644 index 0000000000..f9fe68d48f --- /dev/null +++ b/test/files/run/t9946c.scala @@ -0,0 +1,10 @@ +class Test(private[this] val x: String) { + lazy val y = x.reverse +} +object Test { + def main(args: Array[String]): Unit = { + val t = new Test("foo") + assert(t.y == "oof", t.y) + } +} + |