summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-07 10:50:44 -0800
committerPaul Phillips <paulp@improving.org>2012-01-07 13:48:51 -0800
commitdc1bbb919eda7e3ec49e4b5cd9d726f58d318cf7 (patch)
tree5bb7b72ab1f7ea5732c8ab8a3c64140ceef0baaf /src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
parent27d19715af59e2e438808ae668c093ad61c8f728 (diff)
downloadscala-dc1bbb919eda7e3ec49e4b5cd9d726f58d318cf7.tar.gz
scala-dc1bbb919eda7e3ec49e4b5cd9d726f58d318cf7.tar.bz2
scala-dc1bbb919eda7e3ec49e4b5cd9d726f58d318cf7.zip
TypeConstraint/TypeVar refinement.
I zeroed in on the actual conditions under which the parameter bounds can be utilized without poisoning the well. Also fixed a bug in ClassfileParser where it would get confused and set Any as a lower bound, as well as a bug or at least misbehavior where a TypeBounds with only Any/Nothing as an upper/lower bound would be treated differently than one with no bound at all. Review by @moors.
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index ac72b4d22c..de11f3aa28 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -717,7 +717,12 @@ abstract class ClassfileParser {
index += 1
val bounds = variance match {
case '+' => TypeBounds.upper(objToAny(sig2type(tparams, skiptvs)))
- case '-' => TypeBounds.lower(sig2type(tparams, skiptvs))
+ case '-' =>
+ val tp = sig2type(tparams, skiptvs)
+ // sig2type seems to return AnyClass regardless of the situation:
+ // we don't want Any as a LOWER bound.
+ if (tp.typeSymbol == definitions.AnyClass) TypeBounds.empty
+ else TypeBounds.lower(tp)
case '*' => TypeBounds.empty
}
val newtparam = sym.newExistential(sym.pos, newTypeName("?"+i)) setInfo bounds