diff options
Diffstat (limited to 'tests/run/t3670.scala')
-rw-r--r-- | tests/run/t3670.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/run/t3670.scala b/tests/run/t3670.scala new file mode 100644 index 000000000..b9cee847b --- /dev/null +++ b/tests/run/t3670.scala @@ -0,0 +1,31 @@ +class C { + val things = List("abcs") + + if (things.length < 30) { + lazy val a = "a" + println(a) + } + if (things.length < 30) { + lazy val b = "b" + println(b) + } +} + +class M extends dotty.runtime.LegacyApp { + def foo: Unit = { + lazy val a = { + lazy val b = 1 + lazy val c = 2 + println(b) + println(c) + } + a + lazy val d = 42 + println(d) + } +} + +object Test extends dotty.runtime.LegacyApp { + new C() + new M().foo +} |