Skip to content

Commit 11b7963

Browse files
committed
Merge pull request #700 from dotty-staging/fix/#689-lifted-modules
Drop Module flag from lifted symbols.
2 parents 65b0c37 + b50f9ab commit 11b7963

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/dotty/tools/dotc/transform/LambdaLift.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform
309309
local.copySymDenotation(
310310
owner = newOwner,
311311
name = newName(local),
312-
initFlags = local.flags &~ InSuperCall | Private | maybeStatic,
312+
initFlags = local.flags &~ (InSuperCall | Module) | Private | maybeStatic,
313+
// drop Module because class is no longer a singleton in the lifted context.
313314
info = liftedInfo(local)).installAfter(thisTransform)
314315
if (local.isClass)
315316
for (member <- local.asClass.info.decls)

tests/run/i689.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
object Test {
2+
def main(args: Array[String]): Unit = {
3+
object A {
4+
def a = new A
5+
def y = 0
6+
}
7+
class A { A.y }
8+
A.a
9+
}
10+
}
File renamed without changes.

0 commit comments

Comments
 (0)