diff options
author | Paul Phillips <paulp@improving.org> | 2011-06-22 22:00:53 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-06-22 22:00:53 +0000 |
commit | 83db5e6600ebfd877719f99a96377f6e004cd547 (patch) | |
tree | a022340ac6b2c1f01aef7560a127c525797393dd | |
parent | 9853b5b8292650d8e192b500e636dc441550eef7 (diff) | |
download | scala-83db5e6600ebfd877719f99a96377f6e004cd547.tar.gz scala-83db5e6600ebfd877719f99a96377f6e004cd547.tar.bz2 scala-83db5e6600ebfd877719f99a96377f6e004cd547.zip |
Everything builds for me, but apparently not fo...
Everything builds for me, but apparently not for jenkins. First attempt
to solve mystery: explicitly set return type of Any#getClass() to
Class[_ <: Any] rather than allowing java's to be used. I'm guessing
that somehow it materializes as Class[_ <: Any] sometimes and Class[_ <:
AnyRef] other times. Review by moors.
-rw-r--r-- | src/compiler/scala/reflect/internal/Definitions.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/compiler/scala/reflect/internal/Definitions.scala b/src/compiler/scala/reflect/internal/Definitions.scala index ce869cfd3d..567389d475 100644 --- a/src/compiler/scala/reflect/internal/Definitions.scala +++ b/src/compiler/scala/reflect/internal/Definitions.scala @@ -832,10 +832,13 @@ 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 = ( - newMethod(AnyClass, nme.getClass_, Nil, getMember(ObjectClass, nme.getClass_).tpe.resultType) - setFlag DEFERRED - ) + 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 + } Any_isInstanceOf = newPolyMethod( AnyClass, nme.isInstanceOf_, tparam => NullaryMethodType(booltype)) setFlag FINAL Any_asInstanceOf = newPolyMethod( |