From e6a3566bb7b809b072bd2cedec6770ab932f8f9f Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Thu, 12 Jun 2008 08:48:59 +0000 Subject: Fixed 'isSameType' for refinement types with ov... Fixed 'isSameType' for refinement types with overloaded definitions. Fixes #1014. --- src/compiler/scala/tools/nsc/symtab/Types.scala | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index d508635983..69bee83f09 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -3398,9 +3398,16 @@ A type's typeSymbol should never be inspected directly. case (RefinedType(parents1, ref1), RefinedType(parents2, ref2)) => def isSubScope(s1: Scope, s2: Scope): Boolean = s2.toList.forall { sym2 => - val sym1 = s1.lookup(sym2.name) - sym1 != NoSymbol && - sym1.info =:= sym2.info.substThis(sym2.owner, sym1.owner.thisType) + var e1 = s1.lookupEntry(sym2.name) + (e1 ne null) && { + val substSym = sym2.info.substThis(sym2.owner, e1.sym.owner.thisType) + var isEqual = e1.sym.info =:= substSym + while (!isEqual && (e1 ne null)) { + e1 = s1.lookupNextEntry(e1) + isEqual = e1.sym.info =:= substSym + } + isEqual + } } //Console.println("is same? " + tp1 + " " + tp2 + " " + tp1.typeSymbol.owner + " " + tp2.typeSymbol.owner)//DEBUG isSameTypes(parents1, parents2) && isSubScope(ref1, ref2) && isSubScope(ref2, ref1) -- cgit v1.2.3