summaryrefslogtreecommitdiff
path: root/src/reflect
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-12-09 00:05:47 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-12-09 00:05:47 -0800
commitdb19ddf36ef657e137e2b24fc70375f8476da327 (patch)
treefd5cdfdbbaf62c053cf97c5a39329f3c22ec65e2 /src/reflect
parent4d439dd4b2bb9e2364fc494af9f3ae4686ff9f65 (diff)
parentfdcc262070470e0968afcdf0036cc18781c52e33 (diff)
downloadscala-db19ddf36ef657e137e2b24fc70375f8476da327.tar.gz
scala-db19ddf36ef657e137e2b24fc70375f8476da327.tar.bz2
scala-db19ddf36ef657e137e2b24fc70375f8476da327.zip
Merge pull request #3229 from retronym/ticket/8029
SI-8029 Avoid multi-run cyclic error with companions, package object
Diffstat (limited to 'src/reflect')
-rw-r--r--src/reflect/scala/reflect/internal/Symbols.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala
index b22c706bf4..579f7684fd 100644
--- a/src/reflect/scala/reflect/internal/Symbols.scala
+++ b/src/reflect/scala/reflect/internal/Symbols.scala
@@ -1284,6 +1284,13 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
def hasRawInfo: Boolean = infos ne null
def hasCompleteInfo = hasRawInfo && rawInfo.isComplete
+ // does not run adaptToNewRun, which is prone to trigger cycles (SI-8029)
+ // TODO: give this a better name if you understand the intent of the caller.
+ // Is it something to do with `reallyExists` or `isStale`?
+ final def rawInfoIsNoType: Boolean = {
+ hasRawInfo && (infos.info eq NoType)
+ }
+
/** Return info without checking for initialization or completing */
def rawInfo: Type = {
var infos = this.infos
@@ -1930,7 +1937,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
/** Is this symbol defined in the same scope and compilation unit as `that` symbol? */
def isCoDefinedWith(that: Symbol) = (
- (this.rawInfo ne NoType)
+ !rawInfoIsNoType
&& (this.effectiveOwner == that.effectiveOwner)
&& ( !this.effectiveOwner.isPackageClass
|| (this.sourceFile eq null)