summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-12-10 01:32:30 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-12-10 01:32:30 +0100
commitbb427a34165b0338be8b23baeb61ac0591b3c0a1 (patch)
tree5264fdc35310d6ece84462a6fa550e56cc2aa3f1 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent0c927046dc5df974e6c39187107cf3548825282b (diff)
downloadscala-bb427a34165b0338be8b23baeb61ac0591b3c0a1.tar.gz
scala-bb427a34165b0338be8b23baeb61ac0591b3c0a1.tar.bz2
scala-bb427a34165b0338be8b23baeb61ac0591b3c0a1.zip
SI-8060 Avoid infinite loop with higher kinded type alias
The `dealiasLocals` map was assuming that: tp.isAliasType implies (tp.dealias ne tp) This isn't true if `!typeParamsMatchArgs`. This commit avoids the infinite loop by checking whether or not dealiasing progresses.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index b80dcefef8..40313bdb5d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3826,7 +3826,7 @@ trait Typers extends Modes with Adaptations with Tags {
val normalizeLocals = new TypeMap {
def apply(tp: Type): Type = tp match {
case TypeRef(pre, sym, args) =>
- if (sym.isAliasType && containsLocal(tp)) apply(tp.dealias)
+ if (sym.isAliasType && containsLocal(tp) && (tp.dealias ne tp)) apply(tp.dealias)
else {
if (pre.isVolatile)
InferTypeWithVolatileTypeSelectionError(tree, pre)