diff options
author | James Iry <jamesiry@gmail.com> | 2013-11-06 09:32:59 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-11-06 09:32:59 -0800 |
commit | 66c4135942234cb89020012b0494a13a4a8945dd (patch) | |
tree | 905b8519217b9318fce03b323a40094dfbb04c58 /test | |
parent | 05681d4def04f290728e673b7856a57b872c8019 (diff) | |
parent | e09a8a2b7f821be43703bd5bf3a064e171d8f66c (diff) | |
download | scala-66c4135942234cb89020012b0494a13a4a8945dd.tar.gz scala-66c4135942234cb89020012b0494a13a4a8945dd.tar.bz2 scala-66c4135942234cb89020012b0494a13a4a8945dd.zip |
Merge pull request #3102 from VladUreche/issue/4012
SI-4012 Mixin and specialization work well
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/SI-4012-a.scala | 7 | ||||
-rw-r--r-- | test/files/pos/SI-4012-b.scala | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/files/pos/SI-4012-a.scala b/test/files/pos/SI-4012-a.scala new file mode 100644 index 0000000000..7fceeea3c3 --- /dev/null +++ b/test/files/pos/SI-4012-a.scala @@ -0,0 +1,7 @@ +trait C1[+A] { + def head: A = sys.error("") +} +trait C2[@specialized +A] extends C1[A] { + override def head: A = super.head +} +class C3 extends C2[Char] diff --git a/test/files/pos/SI-4012-b.scala b/test/files/pos/SI-4012-b.scala new file mode 100644 index 0000000000..6bc8592766 --- /dev/null +++ b/test/files/pos/SI-4012-b.scala @@ -0,0 +1,15 @@ +trait Super[@specialized(Int) A] { + def superb = 0 +} + +object Sub extends Super[Int] { + // it is expected that super[Super].superb crashes, since + // specialization does parent class rewiring, and the super + // of Sub becomes Super$mcII$sp and not Super. But I consider + // this normal behavior -- if you want, I can modify duplicatiors + // to make this work, but I consider it's best to keep this + // let the user know Super is not the superclass anymore. + // super[Super].superb - Vlad + super.superb // okay + override def superb: Int = super.superb // okay +} |