From 0fde95e6a4c0659a59519399573ece0e684be660 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Mon, 15 Apr 2013 16:27:12 -0700 Subject: SI-7376 Scaladoc warns when discarding local doc comments with API tags Double-star doc comments in non-dockable positions at the end of a block will emit a warning only if API tags like @author are present, or under -Xlint. A real comment parser is applied early to probe for tags, to minimize ad hoc testing or duplication, but warnings are suppressed. Residual ad hockiness lies in precisely which tags to warn on. Ad hoc or ad doc. This fix is a stop gap; a richer solution would also report about other doc locations that won't be processed. --- test/scaladoc/run/t5527.check | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'test/scaladoc/run/t5527.check') diff --git a/test/scaladoc/run/t5527.check b/test/scaladoc/run/t5527.check index ab2aeb2d67..54595652cd 100644 --- a/test/scaladoc/run/t5527.check +++ b/test/scaladoc/run/t5527.check @@ -1,11 +1,5 @@ -newSource1:17: warning: discarding unmoored doc comment - /** Testing 123 */ - ^ -newSource1:27: warning: discarding unmoored doc comment - /** Calculate this result. */ - ^ -newSource1:34: warning: discarding unmoored doc comment - /** Another digit is a giveaway. */ +newSource1:47: warning: discarding unmoored doc comment + /** Document this crucial constant for posterity. ^ [[syntax trees at end of parser]] // newSource1 package { @@ -48,6 +42,18 @@ package { val test4 = 'a' match { case ('0'| '1'| '2'| '3'| '4'| '5'| '6'| '7'| '8'| '9') => true case _ => false + }; + def test5: scala.Unit = if (true) + $qmark$qmark$qmark + else + (); + def test6 = { + val u = 4; + 0.to(u).foreach(((i) => println(i))) + }; + def test7 = { + val u = 4; + 0.to(u).foreach(((i) => println(i))) } }; /** comments that we should keep */ -- cgit v1.2.3