diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-05-19 22:41:51 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-05-21 09:43:23 +0200 |
commit | 6898d2c296326779d373ef0e0b84e4451550120a (patch) | |
tree | bab904a3bccdfcfa237b6f43a498e262f409db59 /tests/run | |
parent | 4bac1a5fe9fcb0e0154c670fe766b3ea0faee814 (diff) | |
download | dotty-6898d2c296326779d373ef0e0b84e4451550120a.tar.gz dotty-6898d2c296326779d373ef0e0b84e4451550120a.tar.bz2 dotty-6898d2c296326779d373ef0e0b84e4451550120a.zip |
Fix #580: use isContainedIn to support cases where the enclosing class is also the top-level class
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/innerInObject.check | 2 | ||||
-rw-r--r-- | tests/run/innerInObject.scala | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/run/innerInObject.check b/tests/run/innerInObject.check new file mode 100644 index 000000000..1191247b6 --- /dev/null +++ b/tests/run/innerInObject.check @@ -0,0 +1,2 @@ +1 +2 diff --git a/tests/run/innerInObject.scala b/tests/run/innerInObject.scala new file mode 100644 index 000000000..5a5ece416 --- /dev/null +++ b/tests/run/innerInObject.scala @@ -0,0 +1,24 @@ +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) + } +} |