summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/Erasure.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2009-03-30 12:26:51 +0000
committerIulian Dragos <jaguarul@gmail.com>2009-03-30 12:26:51 +0000
commit8087f9b529ad79a403a29117408632366a7534d9 (patch)
tree8b4433279a2352ad4ff4914856a709a418ea7fee /src/compiler/scala/tools/nsc/transform/Erasure.scala
parentb62a73e023b4dad90f1712c448fdf9f456b8ebcf (diff)
downloadscala-8087f9b529ad79a403a29117408632366a7534d9.tar.gz
scala-8087f9b529ad79a403a29117408632366a7534d9.tar.bz2
scala-8087f9b529ad79a403a29117408632366a7534d9.zip
Fixed Java signatures of forwarders for inherit...
Fixed Java signatures of forwarders for inherited members, and references to scala.Nothing are translated to scala.runtime.Nothing$ (see #1254, #1822, #1555). Moved a Java test that was not run to its proper subdirectory, to make partest happy.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/Erasure.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index 3072d2d465..7485e4ae66 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -156,7 +156,10 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer {
UnitClass -> VOID_TAG
)
- def javaSig(sym: Symbol): Option[String] = atPhase(currentRun.erasurePhase) {
+ /** The Java signature of type 'info', for symbol sym. The symbol is used to give the right return
+ * type for constructors.
+ */
+ def javaSig(sym: Symbol, info: Type): Option[String] = atPhase(currentRun.erasurePhase) {
def jsig(tp: Type): String = jsig2(false, List(), tp)
@@ -194,6 +197,10 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer {
jsig(ObjectClass.tpe)
else if (sym == UnitClass)
jsig(BoxedUnitClass.tpe)
+ else if (sym == NothingClass)
+ jsig(RuntimeNothingClass.tpe)
+ else if (sym == NullClass)
+ jsig(RuntimeNullClass.tpe)
else if (isValueClass(sym))
tagOfClass(sym).toString
else if (sym.isClass)
@@ -238,10 +245,10 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer {
else jsig(etp)
}
}
- if (needsJavaSig(sym.info)) {
+ if (needsJavaSig(info)) {
try {
//println("Java sig of "+sym+" is "+jsig2(true, List(), sym.info))//DEBUG
- Some(jsig2(true, List(), sym.info))
+ Some(jsig2(true, List(), info))
} catch {
case ex: UnknownSig => None
}