diff options
author | Martin Odersky <odersky@gmail.com> | 2016-07-11 17:02:16 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 17:47:23 +0200 |
commit | 6d7bc4996d6ad2095442ebc43f59307448226fd7 (patch) | |
tree | 7cee580a3dce11cb59d232c435e90660f3dee6ea /src/dotty/tools/dotc/core/Types.scala | |
parent | a200695677237922fdf6f995c690cb0108ec2fc4 (diff) | |
download | dotty-6d7bc4996d6ad2095442ebc43f59307448226fd7.tar.gz dotty-6d7bc4996d6ad2095442ebc43f59307448226fd7.tar.bz2 dotty-6d7bc4996d6ad2095442ebc43f59307448226fd7.zip |
Address reviewers comments
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 728f7fc21..63f39637b 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -452,7 +452,7 @@ object Types { // We have to be careful because we might open the same (wrt eq) recursive type // twice during findMember which risks picking the wrong prefix in the `substRecThis(rt, pre)` // call below. To avoid this problem we do a defensive copy of the recursive - // type first. But if we do this always we risk being inefficient and we run into + // type first. But if we do this always we risk being inefficient and we ran into // stackoverflows when compiling pos/hk.scala under the refinement encoding // of hk-types. So we only do a copy if the type // is visited again in a recursive call to `findMember`, as tracked by `tp.opened`. @@ -470,7 +470,7 @@ object Types { // // fails (in fact it thinks the underlying type of the LHS is `Tree[Untyped]`.) // - // Without the without the `openedTwice` trick, Typer.scala fails to Ycheck + // Without the `openedTwice` trick, Typer.scala fails to Ycheck // at phase resolveSuper. val rt = if (tp.opened) { // defensive copy @@ -2510,7 +2510,7 @@ object Types { else duplicate(paramNames, paramBounds, resType) /** PolyParam references to all type parameters of this type */ - def paramRefs: List[PolyParam] = paramNames.indices.toList.map(PolyParam(this, _)) + lazy val paramRefs: List[PolyParam] = paramNames.indices.toList.map(PolyParam(this, _)) /** The type `[tparams := paramRefs] tp`, where `tparams` can be * either a list of type parameter symbols or a list of lambda parameters @@ -2518,7 +2518,7 @@ object Types { def lifted(tparams: List[TypeParamInfo], tp: Type)(implicit ctx: Context): Type = tparams match { case LambdaParam(poly, _) :: _ => tp.subst(poly, this) - case tparams: List[Symbol] => tp.subst(tparams, paramRefs) + case tparams: List[Symbol @unchecked] => tp.subst(tparams, paramRefs) } override def equals(other: Any) = other match { @@ -2612,6 +2612,7 @@ object Types { def paramName(implicit ctx: Context): TypeName = tl.paramNames(n) def paramBounds(implicit ctx: Context): TypeBounds = tl.paramBounds(n) def paramBoundsAsSeenFrom(pre: Type)(implicit ctx: Context): TypeBounds = paramBounds + def paramBoundsOrCompleter(implicit ctx: Context): Type = paramBounds def paramVariance(implicit ctx: Context): Int = tl.variances(n) def toArg: Type = PolyParam(tl, n) def paramRef(implicit ctx: Context): Type = PolyParam(tl, n) @@ -2643,7 +2644,7 @@ object Types { override def superType(implicit ctx: Context): Type = tycon match { case tp: TypeLambda => defn.AnyType - case tp: TypeProxy => tp.superType.appliedTo(args) + case tp: TypeProxy => tp.superType.applyIfParameterized(args) case _ => defn.AnyType } /* |