diff options
author | Erik Osheim <d_m@plastic-idolatry.com> | 2012-02-19 00:09:36 -0500 |
---|---|---|
committer | Erik Osheim <d_m@plastic-idolatry.com> | 2012-02-19 00:09:36 -0500 |
commit | 1df4fc6e59e65b202d98486ca698c721122054d2 (patch) | |
tree | 183686c3a4fa2879d51ae5676ad86adbc90886c9 /test/files/run/t5500.scala | |
parent | 1f4f1235920fe87e1b1bdfd042683d9651f1d4f1 (diff) | |
download | scala-1df4fc6e59e65b202d98486ca698c721122054d2.tar.gz scala-1df4fc6e59e65b202d98486ca698c721122054d2.tar.bz2 scala-1df4fc6e59e65b202d98486ca698c721122054d2.zip |
Fixed over-optimistic anyrefSpecCache (closes SI-5500).
The basic problem here was that generic type params were getting
confused between the various specialized subclasses. For instance,
calling typeParamsSubAnyRef(A, C2$mcLI$sp) might return the wrong
specialized type param, e.g. C2$mcLZ$sp.A$sp (note the Z instead
of the I).
The fix is to cache with both the sym (A) and also the clazz
(C2$mcLI$sp). This may resolve a whole host of other obscure
AnyRef specialization problems.
Diffstat (limited to 'test/files/run/t5500.scala')
-rw-r--r-- | test/files/run/t5500.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t5500.scala b/test/files/run/t5500.scala new file mode 100644 index 0000000000..6fbe168a54 --- /dev/null +++ b/test/files/run/t5500.scala @@ -0,0 +1,12 @@ +import scala.{specialized => spec} + +class C1[@spec(Int, AnyRef) A, @spec(Int, AnyRef) B](v:A, w:B) + +class C2[@spec(Unit, Boolean, Byte, Char, Short, Int, Long, Float, Double, AnyRef) A, @spec(Unit, Boolean, Byte, Char, Short, Int, Long, Float, Double, AnyRef) B](v:A, w:B) + +object Test { + def main(args:Array[String]) { + println(new C1("abc", 123).getClass.getName) + println(new C2[String, Int]("abc", 123).getClass.getName) + } +} |