diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-05-16 22:43:53 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2015-05-21 16:29:28 +0200 |
commit | c48badad54f90047f690d02e8af80153c6634412 (patch) | |
tree | 6a0de36f10b33f618203775254460d380982e486 /tests/run/t4535.scala | |
parent | bf81fb62084f9e04e43906396c3ac5e307caca63 (diff) | |
download | dotty-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/t4535.scala')
0 files changed, 0 insertions, 0 deletions