Skip to content

Commit 5bc0be5

Browse files
committed
Add tests that were used to reproduce issues with LazyVals.
1 parent 25ff413 commit 5bc0be5

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tests/run/Lazies1.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object T{ @volatile lazy val s = null}
2+
object Test{
3+
def main(args: Array[String]): Unit = {
4+
T.s
5+
}
6+
}

tests/run/Lazies2.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class T{ @volatile lazy val s = null}
2+
object T{ @volatile lazy val s = null}
3+
object Test{
4+
def main(args: Array[String]): Unit = {
5+
T.s
6+
(new T).s
7+
}
8+
}

0 commit comments

Comments
 (0)