diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/mixin-primitive-on-generic-4.check | 2 | ||||
-rw-r--r-- | tests/run/mixin-primitive-on-generic-4.scala | 21 | ||||
-rw-r--r-- | tests/run/mixin-primitive-on-generic-5.check | 2 | ||||
-rw-r--r-- | tests/run/mixin-primitive-on-generic-5.scala | 21 |
4 files changed, 46 insertions, 0 deletions
diff --git a/tests/run/mixin-primitive-on-generic-4.check b/tests/run/mixin-primitive-on-generic-4.check new file mode 100644 index 000000000..bb101b641 --- /dev/null +++ b/tests/run/mixin-primitive-on-generic-4.check @@ -0,0 +1,2 @@ +true +true diff --git a/tests/run/mixin-primitive-on-generic-4.scala b/tests/run/mixin-primitive-on-generic-4.scala new file mode 100644 index 000000000..ddf62b92f --- /dev/null +++ b/tests/run/mixin-primitive-on-generic-4.scala @@ -0,0 +1,21 @@ + +object Test { + def main(args: Array[String]): Unit = { + println((new Foo: Baz).value1.v) + println((new Foo: Baz).value2.v) + } +} + +class Foo extends Bar[VBoolean](new VBoolean(true)) with Baz + +class Bar[T](x: T) { + def value1: T = x + def value2(): T = x +} + +trait Baz { + def value1: VBoolean + def value2(): VBoolean +} + +class VBoolean(val v: Boolean) extends AnyVal diff --git a/tests/run/mixin-primitive-on-generic-5.check b/tests/run/mixin-primitive-on-generic-5.check new file mode 100644 index 000000000..bb101b641 --- /dev/null +++ b/tests/run/mixin-primitive-on-generic-5.check @@ -0,0 +1,2 @@ +true +true 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 |