diff options
author | Martin Odersky <odersky@gmail.com> | 2007-11-24 18:09:37 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-11-24 18:09:37 +0000 |
commit | 61bfaa4b284f21b531e1b19cb1f4795d7c2dfd5c (patch) | |
tree | 1687ed0ed5c855aa12cd59220ab9ba655d50c45b /src | |
parent | 8e5450bb0944236c0a512f087946ddc5a54dfe19 (diff) | |
download | scala-61bfaa4b284f21b531e1b19cb1f4795d7c2dfd5c.tar.gz scala-61bfaa4b284f21b531e1b19cb1f4795d7c2dfd5c.tar.bz2 scala-61bfaa4b284f21b531e1b19cb1f4795d7c2dfd5c.zip |
Fixed #184
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 87dd555db4..80c9c080e7 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -893,6 +893,7 @@ trait Types { underlyingCache = pre.memberType(sym).resultType; } } + assert(underlyingCache ne this, this) underlyingCache } /* @@ -3012,15 +3013,20 @@ A type's typeSymbol should never be inspected directly. isSameType(atp, tp2) case (_, AnnotatedType(_,atp)) => isSameType(tp1, atp) + case (_: SingletonType, _: SingletonType) => + var origin1 = tp1 + while (origin1.underlying.isInstanceOf[SingletonType]) { + assert(origin1 ne origin1.underlying, origin1) + origin1 = origin1.underlying + } + var origin2 = tp2 + while (origin2.underlying.isInstanceOf[SingletonType]) { + assert(origin2 ne origin2.underlying, origin2) + origin2 = origin2.underlying + } + ((origin1 ne tp1) || (origin2 ne tp2)) && (origin1 =:= origin2) case _ => - if (tp1.isStable && tp2.isStable) { - //todo: replace with widen? - var origin1 = tp1 - while (origin1.underlying.isStable) origin1 = origin1.underlying - var origin2 = tp2 - while (origin2.underlying.isStable) origin2 = origin2.underlying - ((origin1 ne tp1) || (origin2 ne tp2)) && (origin1 =:= origin2) - } else false + false } } || { val tp1n = tp1.normalize |