summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Spoon <lex@lexspoon.org>2007-12-31 19:23:30 +0000
committerLex Spoon <lex@lexspoon.org>2007-12-31 19:23:30 +0000
commitc81cb36f8506ed1e0b8f1b61c532eb8be9f18ef4 (patch)
treec52be16f51e84ee98fb273191185a659d8d58f28
parent50f39cd160990052163b47729fe1cf91f7ce95c6 (diff)
downloadscala-c81cb36f8506ed1e0b8f1b61c532eb8be9f18ef4.tar.gz
scala-c81cb36f8506ed1e0b8f1b61c532eb8be9f18ef4.tar.bz2
scala-c81cb36f8506ed1e0b8f1b61c532eb8be9f18ef4.zip
fix isSubtype0 to more consistently
ignore annotations once the annotations have been checked
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 0ac490f64e..f690766561 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -3471,9 +3471,13 @@ A type's typeSymbol should never be inspected directly.
/** Does type `tp1' conform to `tp2'?
*/
- private def isSubType0(tp1: Type, tp2: Type): Boolean = {
- annotationsConform(tp1, tp2) &&
- ((tp1.withoutAttributes, tp2.withoutAttributes) match {
+ private def isSubType0(tp1raw: Type, tp2raw: Type): Boolean = {
+ if (!annotationsConform(tp1raw, tp2raw))
+ return false
+ val tp1 = tp1raw.withoutAttributes
+ val tp2 = tp2raw.withoutAttributes
+
+ ((tp1, tp2) match {
case (ErrorType, _) => true
case (WildcardType, _) => true
case (_, ErrorType) => true
@@ -3593,11 +3597,11 @@ A type's typeSymbol should never be inspected directly.
sym1 == AllRefClass && tp2.isInstanceOf[SingletonType] && (tp1 <:< tp2.widen))
case _ =>
false
- })
- } || {
+ }) || {
val tp1n = tp1.normalize
val tp2n = tp2.normalize
((tp1n ne tp1) || (tp2n ne tp2)) && isSubType0(tp1n, tp2n)
+ }
}
/** Are `tps1' and `tps2' lists of equal length such