aboutsummaryrefslogtreecommitdiff
path: root/tests/run/i2163.scala
blob: 952f651e3987e66d01c6edc66fa05aa2283fa5f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Base(f: Int => Int) {
  def result = f(3)
}

class Child(x: Int) extends Base(y => x + y)

class Outer(z: Int) {
  class Base(f: Int => Int) {
    def result = f(3)
  }

  class Child(x: Int) extends Base(y => x + y + z)
}

object Test {
  def main(args: Array[String]): Unit = {
    assert(new Child(4).result == 7)
    val o = new Outer(2)
    assert(new o.Child(2).result == 7)
  }
}