summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-10-10 09:27:02 +0200
committerVlad Ureche <vlad.ureche@gmail.com>2012-10-11 17:47:54 +0200
commite3a2d0bc4b1931aa311da0305d12ae7ec00d5e2d (patch)
treec90e04825d716cc4e797232015a6c987202677f5 /src
parent950687520907199e756680baed898c4d75cee1e8 (diff)
downloadscala-e3a2d0bc4b1931aa311da0305d12ae7ec00d5e2d.tar.gz
scala-e3a2d0bc4b1931aa311da0305d12ae7ec00d5e2d.tar.bz2
scala-e3a2d0bc4b1931aa311da0305d12ae7ec00d5e2d.zip
SI-6501 Scaladoc will correctly link to @templated
members
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/doc/model/MemberLookup.scala13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/model/MemberLookup.scala b/src/compiler/scala/tools/nsc/doc/model/MemberLookup.scala
index 09020ae24a..1c783a7d2c 100644
--- a/src/compiler/scala/tools/nsc/doc/model/MemberLookup.scala
+++ b/src/compiler/scala/tools/nsc/doc/model/MemberLookup.scala
@@ -124,12 +124,13 @@ trait MemberLookup {
private def createLinks(syms: List[(Symbol, Symbol)]): List[LinkTo] =
syms.flatMap { case (sym, owner) =>
- if (sym.isClass || sym.isModule || sym.isTrait || sym.isPackage)
- findTemplateMaybe(sym) map (LinkToTpl(_))
- else
- findTemplateMaybe(owner) flatMap { inTpl =>
- inTpl.members find (_.asInstanceOf[EntityImpl].sym == sym) map (LinkToMember(_, inTpl))
- }
+ findTemplateMaybe(sym) match {
+ case Some(tpl) => LinkToTpl(tpl) :: Nil
+ case None =>
+ findTemplateMaybe(owner) flatMap { inTpl =>
+ inTpl.members find (_.asInstanceOf[EntityImpl].sym == sym) map (LinkToMember(_, inTpl))
+ }
+ }
}
private def lookupInTemplate(pos: Position, members: List[String], container: Symbol): List[(Symbol, Symbol)] = {