diff options
Diffstat (limited to 'tests/untried/pos/thistype.scala')
-rw-r--r-- | tests/untried/pos/thistype.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/untried/pos/thistype.scala b/tests/untried/pos/thistype.scala new file mode 100644 index 000000000..265c821ad --- /dev/null +++ b/tests/untried/pos/thistype.scala @@ -0,0 +1,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) + } + +} |