diff options
author | Martin Odersky <odersky@gmail.com> | 2008-08-07 11:12:38 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-08-07 11:12:38 +0000 |
commit | 47fb4c71effb56201931562c70d7055b8fe66d69 (patch) | |
tree | dee3a6b59a0276d6fddef8f983a2c070e279ff27 /src/compiler | |
parent | 1c801f47af1fa34413a9ce749537a9dcb72fdc18 (diff) | |
download | scala-47fb4c71effb56201931562c70d7055b8fe66d69.tar.gz scala-47fb4c71effb56201931562c70d7055b8fe66d69.tar.bz2 scala-47fb4c71effb56201931562c70d7055b8fe66d69.zip |
fixed #828, #1120, subtyping problem with exist...
fixed #828, #1120, subtyping problem with existentials.
Diffstat (limited to 'src/compiler')
3 files changed, 14 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 23fb13277d..6fd2c94c1a 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1408,11 +1408,11 @@ trait Parsers extends NewScanners with MarkupParsers { var top = simplePattern(seqOK) if (seqOK && isIdent) { if (inName == STAR) - return atPos(inSkipToken)(Star(top)) + return atPos(inSkipToken)(Star(stripParens(top))) else if (inName == PLUS) - return atPos(inSkipToken)(makePlus(top)) + return atPos(inSkipToken)(makePlus(stripParens(top))) else if (inName == OPT) - return atPos(inSkipToken)(makeOpt(top)) + return atPos(inSkipToken)(makeOpt(stripParens(top))) } while (isIdent && inName != BAR) { top = reduceStack( diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 93eb31ad3d..54290117d3 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -3548,7 +3548,7 @@ A type's typeSymbol should never be inspected directly. case (SingleType(_, _), ThisType(_)) => tp1 =:= tp2 case (SingleType(_, _), SingleType(_, _)) => tp1 =:= tp2 case (ConstantType(_), ConstantType(_)) => tp1 =:= tp2 - case (TypeRef(pre1, sym1:TypeSkolem, args1), TypeRef(pre2, sym2:TypeSkolem, args2)) + case (TypeRef(pre1, sym1: TypeSkolem, args1), TypeRef(pre2, sym2: TypeSkolem, args2)) if (inIDE && args1 == args2 && pre1 == pre2 && sym1.deSkolemize == sym2.deSkolemize) => true case (TypeRef(pre1, sym1, args1), TypeRef(pre2, sym2, args2)) if !(tp1.isHigherKinded || tp2.isHigherKinded) => @@ -3654,7 +3654,9 @@ A type's typeSymbol should never be inspected directly. if (inIDE) trackTypeIDE(sym1) (sym1 == NothingClass && tp2 <:< AnyClass.tpe || - sym1 == NullClass && tp2.isInstanceOf[SingletonType] && (tp1 <:< tp2.widen)) + sym1 == NullClass && tp2.isInstanceOf[SingletonType] && (tp1 <:< tp2.widen) + || + sym1.isAbstractType && (tp1.bounds.hi <:< tp2)) case _ => false }) || { diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 4da75b3e4f..70df7c9f17 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -414,19 +414,22 @@ abstract class ClassfileParser { def parseMethod() { val jflags = in.nextChar var sflags = transFlags(jflags) + var dropIt = false if ((jflags & JAVA_ACC_PRIVATE) != 0 && !global.settings.XO.value) { val name = pool.getName(in.nextChar) if (name == nme.CONSTRUCTOR) sawPrivateConstructor = true in.skip(2); skipAttributes() } else { - if ((jflags & JAVA_ACC_BRIDGE) != 0) - sflags |= BRIDGE + if ((jflags & JAVA_ACC_BRIDGE) != 0) { + if (global.settings.target.value == "jvm-1.5") sflags |= BRIDGE + else dropIt = true + } if ((sflags & PRIVATE) != 0 && global.settings.XO.value) { in.skip(4); skipAttributes() } else { val name = pool.getName(in.nextChar) - var info = pool.getType(in.nextChar) + var info = pool.getType(in.nextChar) if (name == nme.CONSTRUCTOR) info match { case MethodType(formals, restpe) => @@ -440,7 +443,7 @@ abstract class ClassfileParser { if ((jflags & JAVA_ACC_VARARGS) != 0) { sym.setInfo(arrayToRepeated(sym.info)) } - getScope(jflags).enter(sym) + if (!dropIt) getScope(jflags).enter(sym) } } } |