summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-01-27 17:23:28 +0000
committerMartin Odersky <odersky@gmail.com>2011-01-27 17:23:28 +0000
commit0d29472c7796ce6462e0893d7f401b56cbad1754 (patch)
treecd913cb40bf2cfcdcc04939a872dc7158a5bdcf9
parentdb25b914f56884d5d36b1e16191b0ce870e57faf (diff)
downloadscala-0d29472c7796ce6462e0893d7f401b56cbad1754.tar.gz
scala-0d29472c7796ce6462e0893d7f401b56cbad1754.tar.bz2
scala-0d29472c7796ce6462e0893d7f401b56cbad1754.zip
trying to fix CyclicReference errors for type c...
trying to fix CyclicReference errors for type completion
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala11
-rw-r--r--src/compiler/scala/tools/nsc/interactive/RangePositions.scala11
2 files changed, 9 insertions, 13 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index 2e9248165b..fdce4f8cbf 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -139,11 +139,10 @@ self =>
if (context.unit == null)
context.unit.body = new TreeReplacer(old, result) transform context.unit.body
}
- @tailrec def noLocks(sym: Symbol): Boolean = {
- sym == NoSymbol ||
- (sym.rawflags & LOCKED) == 0 && noLocks(sym.owner)
- }
- if (interruptsEnabled && noLocks(context.owner)) {
+ @inline def isUnlocked(sym: Symbol) = (sym.rawflags & LOCKED) == 0
+ @tailrec def noLocks(sym: Symbol): Boolean = sym == NoSymbol || isUnlocked(sym) && noLocks(sym.owner)
+ def noImportLocks: Boolean = context.imports forall (imp => isUnlocked(imp.tree.symbol))
+ if (interruptsEnabled && noLocks(context.owner) && noImportLocks) {
if (context.unit != null &&
result.pos.isOpaqueRange &&
(result.pos includes context.unit.targetPos)) {
@@ -477,7 +476,7 @@ self =>
def typedTreeAt(pos: Position): Tree = {
informIDE("typedTreeAt " + pos)
val tree = locateTree(pos)
- debugLog("at pos "+pos+" was found: "+tree+tree.pos.show)
+ debugLog("at pos "+pos+" was found: "+tree.getClass+" "+tree.pos.show)
if (stabilizedType(tree) ne null) {
debugLog("already attributed")
tree
diff --git a/src/compiler/scala/tools/nsc/interactive/RangePositions.scala b/src/compiler/scala/tools/nsc/interactive/RangePositions.scala
index 1853abebe8..c451e0da5f 100644
--- a/src/compiler/scala/tools/nsc/interactive/RangePositions.scala
+++ b/src/compiler/scala/tools/nsc/interactive/RangePositions.scala
@@ -261,13 +261,10 @@ self: scala.tools.nsc.Global =>
if (t.pos includes pos) {
if (isEligible(t)) last = t
super.traverse(t)
- } else if (t.symbol != null) {
- for(annot <- t.symbol.annotations if (annot.pos includes pos) && !annot.pos.isTransparent) {
- last = Annotated(TypeTree(annot.atp) setPos annot.pos, t)
- last.setType(annot.atp)
- last.setPos(annot.pos)
- traverseTrees(annot.args)
- }
+ } else t match {
+ case mdef: MemberDef =>
+ traverseTrees(mdef.mods.annotations)
+ case _ =>
}
}
}