summaryrefslogtreecommitdiff
path: root/src/compiler/scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-12-17 15:00:49 +0000
committerMartin Odersky <odersky@gmail.com>2010-12-17 15:00:49 +0000
commit06487c5afb7fa6d90497d3f0086cf5714dd3c1d9 (patch)
treedc7c4a9940730d44318c73020b4e8c33bc40f311 /src/compiler/scala
parent4a442e98e3e8a5c851d30cf782d29be0afc156fa (diff)
downloadscala-06487c5afb7fa6d90497d3f0086cf5714dd3c1d9.tar.gz
scala-06487c5afb7fa6d90497d3f0086cf5714dd3c1d9.tar.bz2
scala-06487c5afb7fa6d90497d3f0086cf5714dd3c1d9.zip
Attempt to fix NoSymbol does not have owner pro...
Attempt to fix NoSymbol does not have owner problem in Eclipse.
Diffstat (limited to 'src/compiler/scala')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala11
-rw-r--r--src/compiler/scala/tools/nsc/interactive/REPL.scala1
-rw-r--r--src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala7
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
4 files changed, 13 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index 5936cbdc5d..03f631a7e4 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -74,6 +74,8 @@ self =>
override def signalDone(context: Context, old: Tree, result: Tree) {
def integrateNew() {
context.unit.body = new TreeReplacer(old, result) transform context.unit.body
+ context.unit.asInstanceOf[RichCompilationUnit].status = PartiallyChecked
+ currentTyperRun = newTyperRun
}
if (activeLocks == 0) {
if (context.unit != null &&
@@ -106,8 +108,8 @@ self =>
// But why are we doing this at all? If it was non-null previously
// integrateNew will already have been called. If it was null previously
// it will still be null now?
- if (context.unit != null)
- integrateNew()
+ // if (context.unit != null)
+ integrateNew()
throw FreshRunReq
}
catch {
@@ -390,7 +392,7 @@ self =>
if (debugIDE) inform("typedTreeAt " + pos)
val unit = unitOf(pos)
val sources = List(unit.source)
- if (unit.status == NotLoaded) reloadSources(sources)
+ if (unit.status == NotLoaded || unit.status == PartiallyChecked) reloadSources(sources)
moveToFront(sources)
val typedTree = currentTyperRun.typedTreeAt(pos)
new Locator(pos) locateIn typedTree
@@ -401,7 +403,7 @@ self =>
if (debugIDE) inform("typedTree" + source + " forceReload: " + forceReload)
val unit = unitOf(source)
val sources = List(source)
- if (unit.status == NotLoaded || forceReload) reloadSources(sources)
+ if (unit.status == NotLoaded || unit.status == PartiallyChecked || forceReload) reloadSources(sources)
moveToFront(sources)
currentTyperRun.typedTree(unitOf(source))
}
@@ -669,4 +671,3 @@ self =>
}
object CancelException extends Exception
-
diff --git a/src/compiler/scala/tools/nsc/interactive/REPL.scala b/src/compiler/scala/tools/nsc/interactive/REPL.scala
index 9572f25a69..f4c9a7effe 100644
--- a/src/compiler/scala/tools/nsc/interactive/REPL.scala
+++ b/src/compiler/scala/tools/nsc/interactive/REPL.scala
@@ -110,6 +110,7 @@ object REPL {
case "reloadAndAskType" :: file :: millis :: Nil =>
comp.askReload(List(toSourceFile(file)), reloadResult)
Thread.sleep(millis.toInt)
+ println("ask type now")
comp.askType(toSourceFile(file), false, typedResult)
show(typedResult)
case List("typed", file) =>
diff --git a/src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala b/src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala
index 83d2270eb7..7e8809c8cd 100644
--- a/src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala
+++ b/src/compiler/scala/tools/nsc/interactive/RichCompilationUnits.scala
@@ -6,10 +6,13 @@ import scala.tools.nsc.util.{SourceFile, Position, NoPosition}
trait RichCompilationUnits { self: Global =>
/** The status value of a unit that has not yet been loaded */
- final val NotLoaded = -1
+ final val NotLoaded = -2
/** The status value of a unit that has not yet been typechecked */
- final val JustParsed = 0
+ final val JustParsed = -1
+
+ /** The status value of a unit that has been partially typechecked */
+ final val PartiallyChecked = 0
class RichCompilationUnit(source: SourceFile) extends CompilationUnit(source) {
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index c20732b2bc..9f022a1d92 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2093,7 +2093,7 @@ trait Typers { self: Analyzer =>
def typedImport(imp : Import) : Import = (transformed remove imp) match {
case Some(imp1: Import) => imp1
- case None => println("unhandled impoprt: "+imp+" in "+unit); imp
+ case None => println("unhandled import: "+imp+" in "+unit); imp
}
def typedStats(stats: List[Tree], exprOwner: Symbol): List[Tree] = {