aboutsummaryrefslogtreecommitdiff
path: root/tests/run/innerObject.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/innerObject.scala')
-rw-r--r--tests/run/innerObject.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run/innerObject.scala b/tests/run/innerObject.scala
new file mode 100644
index 000000000..5a5ece416
--- /dev/null
+++ b/tests/run/innerObject.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)
+ }
+}