Permalink
Browse files

tpe -> tpeHK here and there.

Review by @moors.
  • Loading branch information...
paulp committed Feb 3, 2012
1 parent bbad15b commit b27abca41a2503747b3aeeecf8b8cb355159265f
@@ -2548,8 +2548,8 @@ trait Types extends api.Types { self: SymbolTable =>
override def prefix = maybeRewrap(underlying.prefix)
override def typeArgs = underlying.typeArgs map maybeRewrap
override def params = underlying.params mapConserve { param =>
- val tpe1 = rewrap(param.tpe)
- if (tpe1 eq param.tpe) param else param.cloneSymbol.setInfo(tpe1)
+ val tpe1 = rewrap(param.tpeHK)

This comment has been minimized.

Show comment
Hide comment
@adriaanm

adriaanm May 2, 2012

Member

since tpe1 is the type of a value (a parameter must be a value), tpeHK is not necessary: the expected kind of such a type is always *

@adriaanm

adriaanm May 2, 2012

Member

since tpe1 is the type of a value (a parameter must be a value), tpeHK is not necessary: the expected kind of such a type is always *

This comment has been minimized.

Show comment
Hide comment
@paulp

paulp May 2, 2012

Contributor

Oops, that slipped by. (I hunted these down by examining all the places where "tparam" has its .tpe taken, but once in a while people call their tparams "params"...)

@paulp

paulp May 2, 2012

Contributor

Oops, that slipped by. (I hunted these down by examining all the places where "tparam" has its .tpe taken, but once in a while people call their tparams "params"...)

+ if (tpe1 eq param.tpeHK) param else param.cloneSymbol.setInfo(tpe1)
}
override def paramTypes = underlying.paramTypes map maybeRewrap
override def instantiateTypeParams(formals: List[Symbol], actuals: List[Type]) = {
@@ -5884,8 +5884,8 @@ trait Types extends api.Types { self: SymbolTable =>
foreach3(tvars, tparams, variances)((tvar2, tparam2, variance2) => {
val ok = (tparam2 != tparam) && (
(bound contains tparam2)
- || up && (tparam2.info.bounds.lo =:= tparam.tpe)
- || !up && (tparam2.info.bounds.hi =:= tparam.tpe)
+ || up && (tparam2.info.bounds.lo =:= tparam.tpeHK)
+ || !up && (tparam2.info.bounds.hi =:= tparam.tpeHK)
)
if (ok) {
if (tvar2.constr.inst eq null) cyclic = true
@@ -5899,7 +5899,7 @@ trait Types extends api.Types { self: SymbolTable =>
for (tparam2 <- tparams)
tparam2.info.bounds.lo.dealias match {
case TypeRef(_, `tparam`, _) =>
- tvar addHiBound tparam2.tpe.instantiateTypeParams(tparams, tvars)
+ tvar addHiBound tparam2.tpeHK.instantiateTypeParams(tparams, tvars)
case _ =>
}
} else {
@@ -5909,7 +5909,7 @@ trait Types extends api.Types { self: SymbolTable =>
for (tparam2 <- tparams)
tparam2.info.bounds.hi.dealias match {
case TypeRef(_, `tparam`, _) =>
- tvar addLoBound tparam2.tpe.instantiateTypeParams(tparams, tvars)
+ tvar addLoBound tparam2.tpeHK.instantiateTypeParams(tparams, tvars)
case _ =>
}
}
@@ -732,7 +732,7 @@ abstract class ClassfileParser {
}
val newtparam = sym.newExistential(newTypeName("?"+i), sym.pos) setInfo bounds
existentials += newtparam
- xs += newtparam.tpe //@M should probably be .tpeHK
+ xs += newtparam.tpeHK
i += 1
case _ =>
xs += sig2type(tparams, skiptvs)
@@ -746,7 +746,7 @@ abstract class ClassfileParser {
} else {
// raw type - existentially quantify all type parameters
val eparams = typeParamsToExistentials(classSym, classSym.unsafeTypeParams)
- val t = typeRef(pre, classSym, eparams.map(_.tpe))
+ val t = typeRef(pre, classSym, eparams.map(_.tpeHK))

This comment has been minimized.

Show comment
Hide comment
@paulp

paulp May 2, 2012

Contributor

Just trying to futureproof here.

@paulp

paulp May 2, 2012

Contributor

Just trying to futureproof here.

val res = newExistentialType(eparams, t)
if (settings.debug.value && settings.verbose.value)
println("raw type " + classSym + " -> " + res)
@@ -1057,7 +1057,7 @@ trait Typers extends Modes with Adaptations with Taggings with PatMatVirtualiser
val tparams1 = cloneSymbols(tparams)
val tree1 = if (tree.isType) tree
else TypeApply(tree, tparams1 map (tparam =>
- TypeTree(tparam.tpeHK) setPos tree.pos.focus)) setPos tree.pos //@M/tcpolyinfer: changed tparam.tpe to tparam.tpeHK
+ TypeTree(tparam.tpeHK) setPos tree.pos.focus)) setPos tree.pos
context.undetparams ++= tparams1
notifyUndetparamsAdded(tparams1)
adapt(tree1 setType restpe.substSym(tparams, tparams1), mode, pt, original)
@@ -2960,7 +2960,7 @@ trait Typers extends Modes with Adaptations with Taggings with PatMatVirtualiser
assert(!inPatternMode(mode), modeString(mode)) // this case cannot arise for patterns
val lenientTargs = protoTypeArgs(tparams, formals, mt.resultApprox, pt)
val strictTargs = map2(lenientTargs, tparams)((targ, tparam) =>
- if (targ == WildcardType) tparam.tpe else targ) //@M TODO: should probably be .tpeHK
+ if (targ == WildcardType) tparam.tpeHK else targ)
var remainingParams = paramTypes
def typedArgToPoly(arg: Tree, formal: Type): Tree = { //TR TODO: cleanup
val lenientPt = formal.instantiateTypeParams(tparams, lenientTargs)

0 comments on commit b27abca

Please sign in to comment.