diff options
author | Eugene Vigdorchik <eugene.vigdorchik@gmail.com> | 2013-04-15 13:07:04 +0400 |
---|---|---|
committer | Eugene Vigdorchik <eugene.vigdorchik@gmail.com> | 2013-04-25 00:31:36 +0400 |
commit | 184cac8ebc23aaa912d760649f80484d3adbb2b2 (patch) | |
tree | 76a3912c2dd4f63c49c52a2732ae43ca795e5092 /test | |
parent | fc65423d8d6a7548393d212e17c8563cf40bcfc0 (diff) | |
download | scala-184cac8ebc23aaa912d760649f80484d3adbb2b2.tar.gz scala-184cac8ebc23aaa912d760649f80484d3adbb2b2.tar.bz2 scala-184cac8ebc23aaa912d760649f80484d3adbb2b2.zip |
SI-7367 scaladoc crash on constructing the model for annotations.
Scaladoc only checks primary constructor when building annotation
model.
Here we instead find the constructor matching the annotation's symbol.
Also change TreeFactory.makeTree to return TreeEntity rather than
Option[TreeEntity] and force the caller check for EmptyTree.
Diffstat (limited to 'test')
-rwxr-xr-x | test/scaladoc/run/SI-7367.check | 1 | ||||
-rwxr-xr-x | test/scaladoc/run/SI-7367.scala | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/scaladoc/run/SI-7367.check b/test/scaladoc/run/SI-7367.check new file mode 100755 index 0000000000..3925a0d464 --- /dev/null +++ b/test/scaladoc/run/SI-7367.check @@ -0,0 +1 @@ +Done.
\ No newline at end of file diff --git a/test/scaladoc/run/SI-7367.scala b/test/scaladoc/run/SI-7367.scala new file mode 100755 index 0000000000..6e5a317932 --- /dev/null +++ b/test/scaladoc/run/SI-7367.scala @@ -0,0 +1,25 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + override def code = """ + class annot() extends annotation.StaticAnnotation { + def this(a: Any) = this() + } + + @annot(0) + class B + """ + + def scaladocSettings = "" + + def testModel(root: Package) = { + import access._ + val annotations = root._class("B").annotations + assert(annotations.size == 1) + assert(annotations(0).annotationClass == root._class("annot")) + val args = annotations(0).arguments + assert(args.size == 1) + assert(args(0).value.expression == "0") + } +} |