diff options
author | Paul Phillips <paulp@improving.org> | 2011-06-22 23:32:57 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-06-22 23:32:57 +0000 |
commit | 31c213d1644c7c401780c2165a8419397584dd7b (patch) | |
tree | 70acf234031822512402e6c2d8698bdb558b7970 | |
parent | 781726bf7532b48de19c31c3359ab39d8f30899a (diff) | |
download | scala-31c213d1644c7c401780c2165a8419397584dd7b.tar.gz scala-31c213d1644c7c401780c2165a8419397584dd7b.tar.bz2 scala-31c213d1644c7c401780c2165a8419397584dd7b.zip |
Thrusting spear into darkened alcove attempting...
Thrusting spear into darkened alcove attempting to slay java5 build
failure. No review.
-rw-r--r-- | src/compiler/scala/reflect/internal/Definitions.scala | 12 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 6 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/compiler/scala/reflect/internal/Definitions.scala b/src/compiler/scala/reflect/internal/Definitions.scala index 567389d475..6e14f449f9 100644 --- a/src/compiler/scala/reflect/internal/Definitions.scala +++ b/src/compiler/scala/reflect/internal/Definitions.scala @@ -832,12 +832,14 @@ trait Definitions /*extends reflect.generic.StandardDefinitions*/ { // Since getClass is not actually a polymorphic method, this requires compiler // participation. At the "Any" level, the return type is Class[_] as it is in // java.lang.Object. Java also special cases the return type. - Any_getClass = { - val eparams = typeParamsToExistentials(ClassClass, ClassClass.typeParams) - eparams.head setInfo TypeBounds.empty - val tpe = existentialAbstraction(eparams, appliedType(ClassClass.tpe, List(eparams.head.tpe))) + if (!Properties.isJava5) { + Any_getClass = { + val eparams = typeParamsToExistentials(ClassClass, ClassClass.typeParams) + eparams.head setInfo TypeBounds.empty + val tpe = existentialAbstraction(eparams, appliedType(ClassClass.tpe, List(eparams.head.tpe))) - newMethod(AnyClass, nme.getClass_, Nil, tpe) setFlag DEFERRED + newMethod(AnyClass, nme.getClass_, Nil, tpe) setFlag DEFERRED + } } Any_isInstanceOf = newPolyMethod( AnyClass, nme.isInstanceOf_, tparam => NullaryMethodType(booltype)) setFlag FINAL diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index a2fd3ebbb4..2500c84f98 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -526,9 +526,11 @@ abstract class Erasure extends AddInterfaces } // Methods on Any/Object which we rewrite here while we still know what // is a primitive and what arrived boxed. - private lazy val interceptedMethods = Set[Symbol](Any_##, Object_##, Any_getClass) ++ ( + private lazy val interceptedMethods: Set[Symbol] = ( + Set[Symbol](Any_##, Object_##) + ++ Option(Any_getClass) // Each value class has its own getClass for ultra-precise class object typing. - ScalaValueClasses map (_.tpe member nme.getClass_) + ++ ScalaValueClasses.map(_.tpe member nme.getClass_) ) // -------- erasure on trees ------------------------------------------ |