diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-28 23:09:55 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-09 14:17:34 -0700 |
commit | eed61bed1ff3ff70c32b579a5995da4ce59e2d67 (patch) | |
tree | 2ead9c5956307c395da1b5684d952005542d27a8 /src/reflect/scala/reflect/internal/Types.scala | |
parent | ba36c44c31d1a1e0b5c0cf3d4775edd0ae0d5a13 (diff) | |
download | scala-eed61bed1ff3ff70c32b579a5995da4ce59e2d67.tar.gz scala-eed61bed1ff3ff70c32b579a5995da4ce59e2d67.tar.bz2 scala-eed61bed1ff3ff70c32b579a5995da4ce59e2d67.zip |
Incorporated pull request feedback.
Diffstat (limited to 'src/reflect/scala/reflect/internal/Types.scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/Types.scala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index f8b5d089e8..e15340543e 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -1617,14 +1617,14 @@ trait Types extends api.Types { self: SymbolTable => } protected def computeBaseClasses(tpe: Type): List[Symbol] = { - def csym = tpe.typeSymbol - csym :: { - if (tpe.parents.isEmpty || csym.hasFlag(PACKAGE)) Nil + val parents = tpe.parents // adriaan says tpe.parents does work sometimes, so call it only once + val baseTail = ( + if (parents.isEmpty || parents.head.isInstanceOf[PackageTypeRef]) Nil else { //Console.println("computing base classes of " + typeSymbol + " at phase " + phase);//DEBUG // optimized, since this seems to be performance critical - val superclazz = tpe.firstParent - var mixins = tpe.parents.tail + val superclazz = parents.head // parents.isEmpty was already excluded + var mixins = parents.tail val sbcs = superclazz.baseClasses var bcs = sbcs def isNew(clazz: Symbol): Boolean = ( @@ -1644,7 +1644,8 @@ trait Types extends api.Types { self: SymbolTable => } bcs } - } + ) + tpe.typeSymbol :: baseTail } protected def defineBaseTypeSeqOfCompoundType(tpe: CompoundType) = { |