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.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25138 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
extempore 2011-06-22 22:00:53 +00:00
parent 341f3059b7
commit cb7fe71fdf
1 changed files with 7 additions and 4 deletions

View File

@ -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(