From c48badad54f90047f690d02e8af80153c6634412 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sat, 16 May 2015 22:43:53 +0200 Subject: Mixin: fix the initialization of traits Before this commit, the following code: trait Hello { println("Hello") val x: Int = 1 println("World") } Became: trait Hello extends Object { def (): Hello = { { () } this } 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 Hello extends Object { def (): Hello = { { println("World") () } this } def x(): Int protected def initial$x(): Int = { println("Hello") 1 } } --- tests/run/traitInit.check | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/run/traitInit.check (limited to 'tests/run/traitInit.check') diff --git a/tests/run/traitInit.check b/tests/run/traitInit.check new file mode 100644 index 000000000..f9264f7fb --- /dev/null +++ b/tests/run/traitInit.check @@ -0,0 +1,2 @@ +Hello +World -- cgit v1.2.3