aboutsummaryrefslogtreecommitdiff
path: root/tests/run/traitInit.scala
Commit message (Collapse)AuthorAgeFilesLines
* Mixin: fix the initialization of traitsGuillaume Martres2015-05-211-0/+13
Before this commit, the following code: trait Hello { println("Hello") val x: Int = 1 println("World") } Became: <trait> trait Hello extends Object { def <init>(): Hello = { { () } this } <accessor> def x(): Int protected def initial$x(): Int = { println("Hello") 1 } } Notice that the initialization statements after the last getter were missing, this is now fixed: <trait> trait Hello extends Object { def <init>(): Hello = { { println("World") () } this } <accessor> def x(): Int protected def initial$x(): Int = { println("Hello") 1 } }