aboutsummaryrefslogtreecommitdiff
path: root/tests/run/traitInit.check
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2015-05-16 22:43:53 +0200
committerGuillaume Martres <smarter@ubuntu.com>2015-05-21 16:29:28 +0200
commitc48badad54f90047f690d02e8af80153c6634412 (patch)
tree6a0de36f10b33f618203775254460d380982e486 /tests/run/traitInit.check
parentbf81fb62084f9e04e43906396c3ac5e307caca63 (diff)
downloaddotty-c48badad54f90047f690d02e8af80153c6634412.tar.gz
dotty-c48badad54f90047f690d02e8af80153c6634412.tar.bz2
dotty-c48badad54f90047f690d02e8af80153c6634412.zip
Mixin: fix the initialization of traits
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 } }
Diffstat (limited to 'tests/run/traitInit.check')
-rw-r--r--tests/run/traitInit.check2
1 files changed, 2 insertions, 0 deletions
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