diff options
author | Martin Odersky <odersky@gmail.com> | 2011-09-05 13:43:45 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2011-09-05 13:43:45 +0000 |
commit | c4bb14e760671745104707c8eba7a17918366316 (patch) | |
tree | e231361c8069c57edf0670e967bf104027d7e145 | |
parent | 0d99f59ebaa42eb8717b01de06e8582371b6ccbf (diff) | |
download | scala-c4bb14e760671745104707c8eba7a17918366316.tar.gz scala-c4bb14e760671745104707c8eba7a17918366316.tar.bz2 scala-c4bb14e760671745104707c8eba7a17918366316.zip |
more reflect changes
-rw-r--r-- | src/compiler/scala/reflect/internal/SymbolTable.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/reflect/internal/pickling/UnPickler.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/reflect/runtime/Loaders.scala | 5 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/scala/reflect/internal/SymbolTable.scala b/src/compiler/scala/reflect/internal/SymbolTable.scala index 65c2dc4d46..c54b1c43b2 100644 --- a/src/compiler/scala/reflect/internal/SymbolTable.scala +++ b/src/compiler/scala/reflect/internal/SymbolTable.scala @@ -101,9 +101,13 @@ abstract class SymbolTable extends api.Universe try op finally phase = current } + final def afterPhase[T](ph: Phase)(op: => T): T = atPhase(ph.next)(op) + final def atPhaseNotLaterThan[T](target: Phase)(op: => T): T = + if (target != null && phase.id > target.id) atPhase(target)(op) else op + final def isValid(period: Period): Boolean = period != 0 && runId(period) == currentRunId && { val pid = phaseId(period) diff --git a/src/compiler/scala/reflect/internal/pickling/UnPickler.scala b/src/compiler/scala/reflect/internal/pickling/UnPickler.scala index 70a8d734b7..b4be9760f4 100644 --- a/src/compiler/scala/reflect/internal/pickling/UnPickler.scala +++ b/src/compiler/scala/reflect/internal/pickling/UnPickler.scala @@ -819,9 +819,10 @@ abstract class UnPickler /*extends reflect.generic.UnPickler*/ { protected def errorMissingRequirement(name: Name, owner: Symbol): Symbol = missingHook(owner, name) orElse { + new Error().printStackTrace() MissingRequirementError.notFound( "reference " + (if (name.isTypeName) "type " else "value ") + - name.decode + " of " + owner.tpe.widen + "/" +owner.tpe.typeSymbol.ownerChain) + name.decode + " of " + owner.tpe.widen + "/" +owner.tpe.typeSymbol.ownerChain + "/" + owner.info.members) } def inferMethodAlternative(fun: Tree, argtpes: List[Type], restpe: Type) {} // can't do it; need a compiler for that. diff --git a/src/compiler/scala/reflect/runtime/Loaders.scala b/src/compiler/scala/reflect/runtime/Loaders.scala index 3a6700a105..161d06bdb2 100644 --- a/src/compiler/scala/reflect/runtime/Loaders.scala +++ b/src/compiler/scala/reflect/runtime/Loaders.scala @@ -29,11 +29,13 @@ trait Loaders { self: SymbolTable => // sym setInfo ptpe // } // } + override def complete(sym: Symbol) = { info("completing "+sym+"/"+clazz.fullName) assert(sym == clazz || sym == module || sym == module.moduleClass) // try { - unpickleClass(clazz, module, jClass.forName(clazz.fullName)) + atPhaseNotLaterThan(picklerPhase) { + unpickleClass(clazz, module, jClass.forName(clazz.fullName)) // } catch { // case ex: ClassNotFoundException => makePackage() // case ex: NoClassDefFoundError => makePackage() @@ -48,6 +50,7 @@ trait Loaders { self: SymbolTable => // the clause above and load a collection class such as collection.Iterable. // You'll see an error that class `parallel` has the wrong name. // } + } } override def load(sym: Symbol) = complete(sym) } |