summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/internal/Symbols.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/reflect/internal/Symbols.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/reflect/internal/Symbols.scala')
-rw-r--r--src/compiler/scala/reflect/internal/Symbols.scala19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/compiler/scala/reflect/internal/Symbols.scala b/src/compiler/scala/reflect/internal/Symbols.scala
index 65b60bfa39..058108c285 100644
--- a/src/compiler/scala/reflect/internal/Symbols.scala
+++ b/src/compiler/scala/reflect/internal/Symbols.scala
@@ -334,6 +334,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def isTerm = false // to be overridden
def isType = false // to be overridden
def isClass = false // to be overridden
+ def isBottomClass = false // to be overridden
def isAliasType = false // to be overridden
def isAbstractType = false // to be overridden
private[scala] def isSkolem = false // to be overridden
@@ -951,6 +952,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
}
def hasRawInfo: Boolean = infos ne null
+ def hasCompleteInfo = hasRawInfo && rawInfo.isComplete
/** Return info without checking for initialization or completing */
def rawInfo: Type = {
@@ -1236,17 +1238,15 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
owner == that || owner != NoSymbol && (owner isNestedIn that)
/** Is this class symbol a subclass of that symbol? */
- final def isNonBottomSubClass(that: Symbol): Boolean =
- this == that || this.isError || that.isError ||
+ final def isNonBottomSubClass(that: Symbol): Boolean = (
+ (this eq that) || this.isError || that.isError ||
info.baseTypeIndex(that) >= 0
-
- final def isSubClass(that: Symbol): Boolean = (
- isNonBottomSubClass(that) ||
- this == NothingClass ||
- this == NullClass &&
- (that == AnyClass ||
- that != NothingClass && (that isSubClass ObjectClass))
)
+
+ /** Overridden in NullClass and NothingClass for custom behavior.
+ */
+ def isSubClass(that: Symbol) = isNonBottomSubClass(that)
+
final def isNumericSubClass(that: Symbol): Boolean =
definitions.isNumericSubClass(this, that)
@@ -2425,6 +2425,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
unlock()
validTo = currentPeriod
}
+ override def isSubClass(that: Symbol) = false
override def filter(cond: Symbol => Boolean) = this
override def defString: String = toString
override def locationString: String = ""