diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-22 22:20:53 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-22 22:21:02 +0200 |
commit | 7b1fc312fbaeafbeb1eadc080be1aa2e905963e2 (patch) | |
tree | c4313fe24b49df31d790d28252cf49dab23e09bf /tests | |
parent | 80a65f4b2512bdf1dc46144bea1c000d39319872 (diff) | |
download | dotty-7b1fc312fbaeafbeb1eadc080be1aa2e905963e2.tar.gz dotty-7b1fc312fbaeafbeb1eadc080be1aa2e905963e2.tar.bz2 dotty-7b1fc312fbaeafbeb1eadc080be1aa2e905963e2.zip |
Fix #1263: Suppress super initializer call for val parameters of traits.
Val-parameters of traits don't have an initializer, as other vals do. So
we cannot call the initializer in an initialization sequence of a subclass.
Fixes #1263.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/i1263.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/run/i1263.scala b/tests/run/i1263.scala new file mode 100644 index 000000000..4ae255711 --- /dev/null +++ b/tests/run/i1263.scala @@ -0,0 +1,10 @@ +object Test { + trait Foo(val s: String) + + val foo1 = new Foo("bar") {} + val foo2 = new Foo { override val s = "bar" } + def main(args: Array[String]): Unit = { + assert(foo1.s == "bar") + assert(foo2.s == "bar") + } +} |