summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-06-29 20:47:32 +0000
committerPaul Phillips <paulp@improving.org>2011-06-29 20:47:32 +0000
commitdafa91418a45793a48f5fbe4ee204a5775d276c6 (patch)
tree02b45e45c32e690ef7b59b2e022ae24ca32ded60
parente90e836a1ebc9b7537d9631fabd7abac70266bb0 (diff)
downloadscala-dafa91418a45793a48f5fbe4ee204a5775d276c6.tar.gz
scala-dafa91418a45793a48f5fbe4ee204a5775d276c6.tar.bz2
scala-dafa91418a45793a48f5fbe4ee204a5775d276c6.zip
Forward-ported the 2.8.1 specialized naming logic.
-rw-r--r--src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
index ad40e8568e..e87e82720d 100644
--- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
+++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
@@ -218,6 +218,15 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
specializedName(sym.name, tvars1 map env, tvars2 map env)
}
+ /** Great moments in backward compatibility: the specialized names in 2.8.1
+ * were created based on data which mapped "Long" to "L" instead of "J", so we
+ * preserve that here.
+ */
+ private def abbrvTag281(t: Type) = definitions.abbrvTag(t.typeSymbol) match {
+ case 'L' => 'J'
+ case ch => ch
+ }
+
/** Specialize name for the two list of types. The first one denotes
* specialization on method type parameters, the second on outer environment.
*/
@@ -231,8 +240,8 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
else {
val (base, cs, ms) = nme.splitSpecializedName(name)
newTermName(base.toString + "$"
- + "m" + ms + types1.map(t => definitions.abbrvTag(t.typeSymbol)).mkString("", "", "")
- + "c" + cs + types2.map(t => definitions.abbrvTag(t.typeSymbol)).mkString("", "", "$sp"))
+ + "m" + ms + types1.map(abbrvTag281).mkString("", "", "")
+ + "c" + cs + types2.map(abbrvTag281).mkString("", "", "$sp"))
}
}