From 23a3ac4ee21499a4d2fbffb5cecff88c7e03790c Mon Sep 17 00:00:00 2001 From: Kato Kazuyoshi Date: Fri, 27 Mar 2015 19:21:22 -0700 Subject: SI-8210 Scaladoc: Fix the false negative @inheritdoc warning on accessors This fix is just for the false negative warning. Probably we can skip setters entirely, but I'm not 100% sure. --- src/compiler/scala/tools/nsc/ast/DocComments.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala index 02a199f7ac..6442ef2d54 100755 --- a/src/compiler/scala/tools/nsc/ast/DocComments.scala +++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala @@ -76,9 +76,9 @@ trait DocComments { self: Global => superComment(sym) match { case None => - if (ownComment.indexOf("@inheritdoc") != -1) - reporter.warning(sym.pos, "The comment for " + sym + - " contains @inheritdoc, but no parent comment is available to inherit from.") + // SI-8210 - The warning would be false negative when this symbol is a setter + if (ownComment.indexOf("@inheritdoc") != -1 && ! sym.isSetter) + reporter.warning(sym.pos, s"The comment for ${sym} contains @inheritdoc, but no parent comment is available to inherit from.") ownComment.replaceAllLiterally("@inheritdoc", "") case Some(sc) => if (ownComment == "") sc -- cgit v1.2.3