diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-01-11 18:41:58 +0100 |
---|---|---|
committer | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-01-11 18:41:58 +0100 |
commit | cf57534c6141593fbe2ac2fec9d101fa662ecf05 (patch) | |
tree | 440cddbb105cf313032ff9b6d1d433f379e098a8 /tests/run/mixin-primitive-on-generic-5.scala | |
parent | 9f505a42a1c100eedab9748321a77d4bc345af61 (diff) | |
download | dotty-cf57534c6141593fbe2ac2fec9d101fa662ecf05.tar.gz dotty-cf57534c6141593fbe2ac2fec9d101fa662ecf05.tar.bz2 dotty-cf57534c6141593fbe2ac2fec9d101fa662ecf05.zip |
Add PrimitiveForwarders and fix forwarding on value classes.
Diffstat (limited to 'tests/run/mixin-primitive-on-generic-5.scala')
-rw-r--r-- | tests/run/mixin-primitive-on-generic-5.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/run/mixin-primitive-on-generic-5.scala b/tests/run/mixin-primitive-on-generic-5.scala new file mode 100644 index 000000000..438c130de --- /dev/null +++ b/tests/run/mixin-primitive-on-generic-5.scala @@ -0,0 +1,21 @@ + +object Test { + def main(args: Array[String]): Unit = { + println((new Foo: Bar[VBoolean]).value1.v) + println((new Foo: Bar[VBoolean]).value2.v) + } +} + +class Foo extends Baz with Bar[VBoolean] + +trait Bar[T] { + def value1: T + def value2(): T +} + +class Baz { + def value1: VBoolean = new VBoolean(true) + def value2(): VBoolean = new VBoolean(true) +} + +class VBoolean(val v: Boolean) extends AnyVal |