aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-29 15:46:05 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-29 15:46:05 +0200
commit78aa68223cc0869d2b103805ccc85d6bdf54a4e7 (patch)
tree865826d585d5a8e89abdfc037fd626001de3629f
parent7bc7c9ba5e04b9a17ed7d548f3ea8caf7bd8c4a7 (diff)
downloaddotty-78aa68223cc0869d2b103805ccc85d6bdf54a4e7.tar.gz
dotty-78aa68223cc0869d2b103805ccc85d6bdf54a4e7.tar.bz2
dotty-78aa68223cc0869d2b103805ccc85d6bdf54a4e7.zip
Revert "Fix #580: use isContainedIn to support cases where the enclosing class is also the top-level class"
This reverts commit 6898d2c296326779d373ef0e0b84e4451550120a.
-rw-r--r--src/dotty/tools/dotc/transform/LambdaLift.scala2
-rw-r--r--tests/run/innerInObject.check2
-rw-r--r--tests/run/innerInObject.scala24
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)
- }
-}