aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/thistype.scala
blob: 265c821ad6ee0d0d2449976688c93ed955de85ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
object Test {

  class Ctl {
    def enable: this.type = { Console.println("enable"); this }
  }

  class MouseCtl extends Ctl {
    def mouseDown(x: Int, y: Int): Unit = { Console.println("mouse down") }
  }

  def main(args: Array[String]): Unit = {
    new MouseCtl().enable.mouseDown(1, 2)
  }

}