aboutsummaryrefslogtreecommitdiff
path: root/tests/run/innerObject.scala
blob: 5a5ece416d99e0284bc764af1a78c721be203f3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
  }
}