summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-11-28 08:03:10 +0000
committerPaul Phillips <paulp@improving.org>2011-11-28 08:03:10 +0000
commit0bea2ab5f6b211a83bbf14ea46fe57b8163c6334 (patch)
tree1eda4c329deee6b43d82f5922fc58f3de878638d /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parente4c5e04b06fc434eace07798486a108b6e2d4ae7 (diff)
downloadscala-0bea2ab5f6b211a83bbf14ea46fe57b8163c6334.tar.gz
scala-0bea2ab5f6b211a83bbf14ea46fe57b8163c6334.tar.bz2
scala-0bea2ab5f6b211a83bbf14ea46fe57b8163c6334.zip
Fix for erroneous bytecode generation.
A remedy for an IllegalAccessError where generated bytecode referred to an inaccessible type. Closes SI-1430. Bonus materials: - tore out all the invokedynamic support. The shipped jdk7 implementation shows limited resemblance to the one this was written against; the code mostly serves to distract. (I think I could get invokedynamic working pretty quickly, except that it would mean having a codebase for java7 and one for 5-6, which is not a yak I wish to shave today.) - gave NullClass and NothingClass objects of their own, which allowed a nice polymorphic simplification of isSubClass, plus a couple other streamlinings.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 054fb1c036..62ad78c64d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1033,8 +1033,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser {
&& qual.isTerm
&& ((qual.symbol eq null) || !qual.symbol.isTerm || qual.symbol.isValue)
&& !qtpe.isError
- && qtpe.typeSymbol != NullClass
- && qtpe.typeSymbol != NothingClass
+ && !qtpe.typeSymbol.isBottomClass
&& qtpe != WildcardType
&& !qual.isInstanceOf[ApplyImplicitView] // don't chain views
&& context.implicitsEnabled
@@ -2190,10 +2189,8 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser {
* in an argument closure overlaps with an uninstantiated formal?
*/
def needsInstantiation(tparams: List[Symbol], formals: List[Type], args: List[Tree]) = {
- def isLowerBounded(tparam: Symbol) = {
- val losym = tparam.info.bounds.lo.typeSymbol
- losym != NothingClass && losym != NullClass
- }
+ def isLowerBounded(tparam: Symbol) = !tparam.info.bounds.lo.typeSymbol.isBottomClass
+
(formals, args).zipped exists {
case (formal, Function(vparams, _)) =>
(vparams exists (_.tpt.isEmpty)) &&