diff options
-rw-r--r-- | src/dotty/tools/dotc/transform/LambdaLift.scala | 2 | ||||
-rw-r--r-- | tests/run/innerInObject.check | 2 | ||||
-rw-r--r-- | tests/run/innerInObject.scala | 24 |
3 files changed, 1 insertions, 27 deletions
diff --git a/src/dotty/tools/dotc/transform/LambdaLift.scala b/src/dotty/tools/dotc/transform/LambdaLift.scala index 0cbbb769f..42c6e85af 100644 --- a/src/dotty/tools/dotc/transform/LambdaLift.scala +++ b/src/dotty/tools/dotc/transform/LambdaLift.scala @@ -292,7 +292,7 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform val encClass = local.enclosingClass val topClass = local.topLevelClass // member of a static object - if (encClass.isStatic && encClass.isContainedIn(topClass)) { + if (encClass.isStatic && encClass.isProperlyContainedIn(topClass)) { // though the second condition seems weird, it's not true for symbols which are defined in some // weird combinations of super calls. (encClass, EmptyFlags) diff --git a/tests/run/innerInObject.check b/tests/run/innerInObject.check deleted file mode 100644 index 1191247b6..000000000 --- a/tests/run/innerInObject.check +++ /dev/null @@ -1,2 +0,0 @@ -1 -2 diff --git a/tests/run/innerInObject.scala b/tests/run/innerInObject.scala deleted file mode 100644 index 5a5ece416..000000000 --- a/tests/run/innerInObject.scala +++ /dev/null @@ -1,24 +0,0 @@ -object Test { - def foo(x: Int) = { - println(x) - } - - def outer(x: Int) = { - def inner() = { - foo(x) - } - inner() - } - - def outer2(x: Int) = { - def inner2() = { - Test.foo(x) - } - inner2() - } - - def main(args: Array[String]): Unit = { - outer(1) - outer2(2) - } -} |