Skip to content

Commit 87a5ab2

Browse files
committed
Guard agains lifting symbols defined in super-calls to non-static members of package.
1 parent d109796 commit 87a5ab2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,12 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform
289289
for ((local, lOwner) <- liftedOwner) {
290290
val (newOwner, maybeStatic) =
291291
if (lOwner is Package) {
292-
if (local.enclosingClass.isStatic) // member of a static object
292+
// member of a static object
293+
if (local.enclosingClass.isStatic && local.enclosingClass.isProperlyContainedIn(local.topLevelClass)) {
294+
// though the second condition seems wierd, it's not true for symbols which are defined in some
295+
// weird combinations of super calls.
293296
(local.enclosingClass, EmptyFlags)
294-
else
297+
} else
295298
(local.topLevelClass, JavaStatic)
296299
}
297300
else (lOwner, EmptyFlags)

0 commit comments

Comments
 (0)