summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2010-06-18 16:48:34 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2010-06-18 16:48:34 +0000
commitc084ad2bcd697b7678888e1bf09470b37d2199f9 (patch)
treed59277f1c53116e87c5f4c38749a2b393ddaab39 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent109924d63ebc61977f843e35465d48722ed13ea9 (diff)
downloadscala-c084ad2bcd697b7678888e1bf09470b37d2199f9.tar.gz
scala-c084ad2bcd697b7678888e1bf09470b37d2199f9.tar.bz2
scala-c084ad2bcd697b7678888e1bf09470b37d2199f9.zip
[scaladoc] A warning is printed when usecase me...
[scaladoc] A warning is printed when usecase members have different names than the real member being commented. Review by odersky. Contributed by Pedro Furlanetto.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index a045a41132..0f465979b2 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3754,12 +3754,17 @@ trait Typers { self: Analyzer =>
docComments(sym) = comment
comment.defineVariables(sym)
val typer1 = newTyper(context.makeNewScope(tree, context.owner))
- for (useCase <- comment.useCases)
+ for (useCase <- comment.useCases) {
typer1.silent(_.typedUseCase(useCase)) match {
case ex: TypeError =>
unit.warning(useCase.pos, ex.msg)
case _ =>
}
+ useCase.defined foreach { symbol =>
+ if (sym.name.toString != symbol.name.toString)
+ unit.warning(useCase.pos, "@usecase "+symbol.name+" does not match commented symbol: "+sym.name)
+ }
+ }
}
typed(defn, mode, pt)