diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-11-03 11:05:48 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-11-07 11:40:03 +1000 |
commit | 51745c06f318f859b313c8257a41221837671ac1 (patch) | |
tree | 3e36f237343fabcd6416701e0f304ae8ed0b4b26 /src/scaladoc | |
parent | 2d8f919389fa33a554c5fb828bfa040f1b2531e4 (diff) | |
download | scala-51745c06f318f859b313c8257a41221837671ac1.tar.gz scala-51745c06f318f859b313c8257a41221837671ac1.tar.bz2 scala-51745c06f318f859b313c8257a41221837671ac1.zip |
More uniform treatment of package objects
- Introduce `Symbol#packageObject` and `Type#packageObject`
to lookup the member package object of a package class/module,
and use this far and wide.
- Replace the overly complicated (and still buggy) implementation
of `Context#isInPackageObject` with a one liner. The simplifying
insight is that if we select a symbol from a package prefix
that does not own that symbol, it *must* have really been
selected from the package object.
- Change implicit search to use the cache in
`ModuleSymbol#implicitMembers` via `Type#implicitMembers`,
which lets the client code read more naturally.
Fixes a bug with `adapt::insertApply` that Adriaan spotted in a feat
of lateral thinking. This is tested in t8862b.scala. alladin763.scala
adds the test case from the bug originally remedied by `insertApply`
to check we haven't regressed.
Diffstat (limited to 'src/scaladoc')
-rw-r--r-- | src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala index bcb97639c6..b300752a34 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala @@ -177,7 +177,7 @@ trait DiagramDirectiveParser { def warning(message: String) = { // we need the position from the package object (well, ideally its comment, but yeah ...) - val sym = if (template.sym.hasPackageFlag) template.sym.info.member(global.nme.PACKAGE) else template.sym + val sym = if (template.sym.hasPackageFlag) template.sym.packageObject else template.sym assert((sym != global.NoSymbol) || (sym == global.rootMirror.RootPackage)) global.reporter.warning(sym.pos, message) } |