diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-07-27 01:38:45 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-07-27 14:09:39 -0700 |
commit | e5121c888239b3a18ea7b341981d41bb4c9a1c07 (patch) | |
tree | baf179d23d2901cae7a9400307e623f0472c42bd /src/scaladoc | |
parent | ced7214959c05eb5fcf55b79f4a6691d2d8dc987 (diff) | |
download | scala-e5121c888239b3a18ea7b341981d41bb4c9a1c07.tar.gz scala-e5121c888239b3a18ea7b341981d41bb4c9a1c07.tar.bz2 scala-e5121c888239b3a18ea7b341981d41bb4c9a1c07.zip |
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.
Diffstat (limited to 'src/scaladoc')
-rw-r--r-- | src/scaladoc/scala/tools/nsc/doc/ScaladocGlobal.scala | 10 |
1 files changed, 10 insertions, 0 deletions
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 } + } } } |