diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index aa88996876..509f9b3835 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -968,6 +968,7 @@ trait Types extends reflect.generic.Types { self: SymbolTable => incCounter(singletonBaseTypeSeqCount) underlying.baseTypeSeq prepend this } + override def isHigherKinded = false // singleton type classifies objects, thus must be kind * override def safeToString: String = prefixString + "type" /* override def typeOfThis: Type = typeSymbol.typeOfThis @@ -1082,9 +1083,9 @@ trait Types extends reflect.generic.Types { self: SymbolTable => underlyingPeriod = currentPeriod if (!isValid(period)) { underlyingCache = pre.memberType(sym).resultType; + assert(underlyingCache ne this, this) } } - assert(underlyingCache ne this, this) underlyingCache } @@ -3051,17 +3052,13 @@ A type's typeSymbol should never be inspected directly. var capturedPre = emptySymMap - def stabilize(pre: Type, clazz: Symbol): Type = { - capturedPre get clazz match { - case Some(qvar) => - qvar - case _ => + def stabilize(pre: Type, clazz: Symbol): Type = + capturedPre.getOrElse(clazz, { val qvar = clazz freshExistential ".type" setInfo singletonBounds(pre) capturedPre += (clazz -> qvar) capturedParams = qvar :: capturedParams qvar - } - }.tpe + }).tpe /** Return pre.baseType(clazz), or if that's NoType and clazz is a refinement, pre itself. * See bug397.scala for an example where the second alternative is needed. @@ -3122,7 +3119,7 @@ A type's typeSymbol should never be inspected directly. appliedType(as.head, args mapConserve (this)) // @M: was as.head else instParam(ps.tail, as.tail); val symclazz = sym.owner - if (symclazz == clazz && (pre.widen.typeSymbol isNonBottomSubClass symclazz)) { + if (symclazz == clazz && !pre.isInstanceOf[TypeVar] && (pre.widen.typeSymbol isNonBottomSubClass symclazz)) { pre.baseType(symclazz) match { case TypeRef(_, basesym, baseargs) => //Console.println("instantiating " + sym + " from " + basesym + " with " + basesym.typeParams + " and " + baseargs+", pre = "+pre+", symclazz = "+symclazz);//DEBUG |