diff options
-rw-r--r-- | src/dotty/tools/dotc/transform/LambdaLift.scala | 3 | ||||
-rw-r--r-- | tests/run/i689.scala | 10 | ||||
-rw-r--r-- | tests/run/t8002.scala (renamed from tests/pending/run/t8002.scala) | 0 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/transform/LambdaLift.scala b/src/dotty/tools/dotc/transform/LambdaLift.scala index 043c92737..cefd283be 100644 --- a/src/dotty/tools/dotc/transform/LambdaLift.scala +++ b/src/dotty/tools/dotc/transform/LambdaLift.scala @@ -309,7 +309,8 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform local.copySymDenotation( owner = newOwner, name = newName(local), - initFlags = local.flags &~ InSuperCall | Private | maybeStatic, + initFlags = local.flags &~ (InSuperCall | Module) | Private | maybeStatic, + // drop Module because class is no longer a singleton in the lifted context. info = liftedInfo(local)).installAfter(thisTransform) if (local.isClass) for (member <- local.asClass.info.decls) diff --git a/tests/run/i689.scala b/tests/run/i689.scala new file mode 100644 index 000000000..262d13852 --- /dev/null +++ b/tests/run/i689.scala @@ -0,0 +1,10 @@ +object Test { + def main(args: Array[String]): Unit = { + object A { + def a = new A + def y = 0 + } + class A { A.y } + A.a + } +} diff --git a/tests/pending/run/t8002.scala b/tests/run/t8002.scala index c27e83a46..c27e83a46 100644 --- a/tests/pending/run/t8002.scala +++ b/tests/run/t8002.scala |