summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-04-01 17:09:59 +0000
committerKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-04-01 17:09:59 +0000
commit4df2e9335b7f8831f7877baf855c28bb35d90c18 (patch)
tree79a93ca2247a7519199dcc34b87140a936089114
parent1fd0b31aeca299d7f114578addf887f828d1e36b (diff)
downloadscala-4df2e9335b7f8831f7877baf855c28bb35d90c18.tar.gz
scala-4df2e9335b7f8831f7877baf855c28bb35d90c18.tar.bz2
scala-4df2e9335b7f8831f7877baf855c28bb35d90c18.zip
Put "\n" between superclass's comment and subcl...
Put "\n" between superclass's comment and subclass's. Closes #4289. Review by pedrofurla.
-rwxr-xr-xsrc/compiler/scala/tools/nsc/ast/DocComments.scala4
-rw-r--r--test/scaladoc/resources/Trac4289.scala13
-rw-r--r--test/scaladoc/scala/html/HtmlFactoryTest.scala13
3 files changed, 29 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala
index 51c1fab0f1..9764e92cde 100755
--- a/src/compiler/scala/tools/nsc/ast/DocComments.scala
+++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala
@@ -178,10 +178,12 @@ trait DocComments { self: SymbolTable =>
if (end > tocopy) tocopy = end
case None =>
srcSec match {
- case Some((start1, end1)) =>
+ case Some((start1, end1)) => {
out append dst.substring(copied, tocopy).trim
+ out append "\n"
copied = tocopy
out append src.substring(start1, end1).trim
+ }
case None =>
}
}
diff --git a/test/scaladoc/resources/Trac4289.scala b/test/scaladoc/resources/Trac4289.scala
new file mode 100644
index 0000000000..1644e18bd4
--- /dev/null
+++ b/test/scaladoc/resources/Trac4289.scala
@@ -0,0 +1,13 @@
+class Superclass {
+ /**
+ * @return 123
+ */
+ def foo = 123
+}
+
+class Subclass extends Superclass {
+ /**
+ * hello
+ */
+ override def foo = 456
+}
diff --git a/test/scaladoc/scala/html/HtmlFactoryTest.scala b/test/scaladoc/scala/html/HtmlFactoryTest.scala
index 651a384dbf..c0cd55a7e7 100644
--- a/test/scaladoc/scala/html/HtmlFactoryTest.scala
+++ b/test/scaladoc/scala/html/HtmlFactoryTest.scala
@@ -244,4 +244,17 @@ object Test extends Properties("HtmlFactory") {
case _ => false
}
}
+
+ property("Trac #4289") = {
+ val files = createTemplates("Trac4289.scala")
+
+ files("Subclass.html") match {
+ case node: scala.xml.Node => {
+ node.toString.contains {
+ """<dt>returns</dt><dd class="cmt"><p>123</p></dd>"""
+ }
+ }
+ case _ => false
+ }
+ }
}