diff options
Diffstat (limited to 'tests/pos/lazyvals.scala')
-rw-r--r-- | tests/pos/lazyvals.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/pos/lazyvals.scala b/tests/pos/lazyvals.scala new file mode 100644 index 000000000..93a82cd0c --- /dev/null +++ b/tests/pos/lazyvals.scala @@ -0,0 +1,18 @@ + + +trait Iterator { + + def span() = { + val self: Int = 33 + class Leading { + def finish(): Unit = println("finished") + } + val leading = new Leading + + class Trailing { + @volatile lazy val it = leading.finish() + } + val trailing = new Trailing + (leading, trailing) + } +} |