summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/Symbols.scala
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2016-08-10 09:30:49 +0100
committerMiles Sabin <miles@milessabin.com>2016-08-15 18:32:45 +0100
commitd171b2cc16cc129e0f3aa03c3df9b2fb86208aa6 (patch)
treed95c542dddf2ae9e8c12843cd1b6478a7e5ad2c6 /src/reflect/scala/reflect/internal/Symbols.scala
parent81a67eeacc7d2622ee364a21203b227142e2043e (diff)
downloadscala-d171b2cc16cc129e0f3aa03c3df9b2fb86208aa6.tar.gz
scala-d171b2cc16cc129e0f3aa03c3df9b2fb86208aa6.tar.bz2
scala-d171b2cc16cc129e0f3aa03c3df9b2fb86208aa6.zip
Partial fix for SI-7046
Diffstat (limited to 'src/reflect/scala/reflect/internal/Symbols.scala')
-rw-r--r--src/reflect/scala/reflect/internal/Symbols.scala17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala
index 3b9ee9048a..6116952c70 100644
--- a/src/reflect/scala/reflect/internal/Symbols.scala
+++ b/src/reflect/scala/reflect/internal/Symbols.scala
@@ -110,6 +110,16 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def knownDirectSubclasses = {
// See `getFlag` to learn more about the `isThreadsafe` call in the body of this method.
if (!isCompilerUniverse && !isThreadsafe(purpose = AllOps)) initialize
+
+ enclosingPackage.info.decls.foreach { sym =>
+ if(sourceFile == sym.sourceFile) {
+ sym.rawInfo.forceDirectSuperclasses
+ }
+ }
+
+ if(!isPastTyper)
+ updateAttachment(KnownDirectSubclassesCalled)
+
children
}
@@ -3351,7 +3361,12 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
private[this] var childSet: Set[Symbol] = Set()
override def children = childSet
- override def addChild(sym: Symbol) { childSet = childSet + sym }
+ override def addChild(sym: Symbol) {
+ if(!isPastTyper && hasAttachment[KnownDirectSubclassesCalled.type] && !childSet.contains(sym))
+ globalError(s"knownDirectSubclasses of ${this.name} observed before subclass ${sym.name} registered")
+
+ childSet = childSet + sym
+ }
def anonOrRefinementString = {
if (hasCompleteInfo) {