aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test/transform/LazyValsTest.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test/transform/LazyValsTest.scala b/test/test/transform/LazyValsTest.scala
index edcc7ce0c..6e44f3b15 100644
--- a/test/test/transform/LazyValsTest.scala
+++ b/test/test/transform/LazyValsTest.scala
@@ -7,6 +7,15 @@ import org.junit.Assert
class LazyValsTest extends DottyTest {
@Test
+ def doNotRewriteObjects = {
+ checkCompile("LazyVals", "object O"){ (tree, ctx) =>
+ Assert.assertTrue("local lazy shouldn't rewrite module instance definitions", tree.toString.contains(
+ "ValDef(Modifiers(final module <stable>,,List()),O,Ident(O$),Apply(Select(New(Ident(O$)),<init>),List()))"
+ ))
+ }
+ }
+
+ @Test
def localInt = {
checkCompile("LazyVals", "class LocalLV { def m = { lazy val s = 1; s }}"){ (tree, ctx) =>
Assert.assertTrue("local lazy int rewritten to class creation", tree.toString.contains(