From e5121c888239b3a18ea7b341981d41bb4c9a1c07 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Sat, 27 Jul 2013 01:38:45 -0700 Subject: Remove dependency on typer phase in ClassfileParser. ClassfileParser depends on forcing infos during typer phase. It's not entirely clear why this is needed (git blame doesn't help much) but I decided to preserve the logic. Therefore, I introduced an abstract method called `lookupMemberAtTyperPhaseIfPossible` which preserves the original semantics but is implemented outside of ClassfileParser so the ClassfileParser itself doesn't need to depend on typer phase and phase mutation utilities. I removed `loaders` override in `test/files/presentation/doc`. I would have to update it to implement the `lookupMemberAtTyperPhaseIfPossible` method. However, the override doesn't seem to be doing anything useful so I just removed it. --- src/scaladoc/scala/tools/nsc/doc/ScaladocGlobal.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/scaladoc') diff --git a/src/scaladoc/scala/tools/nsc/doc/ScaladocGlobal.scala b/src/scaladoc/scala/tools/nsc/doc/ScaladocGlobal.scala index 20f24dc753..91d5fef4cf 100644 --- a/src/scaladoc/scala/tools/nsc/doc/ScaladocGlobal.scala +++ b/src/scaladoc/scala/tools/nsc/doc/ScaladocGlobal.scala @@ -32,6 +32,16 @@ trait ScaladocGlobalTrait extends Global { override protected def signalError(root: Symbol, ex: Throwable) { log(s"Suppressing error involving $root: $ex") } + + def lookupMemberAtTyperPhaseIfPossible(sym: Symbol, name: Name): Symbol = { + def lookup = sym.info.member(name) + // if loading during initialization of `definitions` typerPhase is not yet set. + // in that case we simply load the member at the current phase + if (currentRun.typerPhase eq null) + lookup + else + enteringTyper { lookup } + } } } -- cgit v1.2.3