From e249f2eeb8451c1b754711294ed954c8de7775fb Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 10 Dec 2012 12:46:13 +0100 Subject: SI-4922 Show default in Scaladoc for generic methods. We must account for cloned symbols. --- test/scaladoc/run/t4922.check | 1 + test/scaladoc/run/t4922.scala | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/scaladoc/run/t4922.check create mode 100644 test/scaladoc/run/t4922.scala (limited to 'test/scaladoc') diff --git a/test/scaladoc/run/t4922.check b/test/scaladoc/run/t4922.check new file mode 100644 index 0000000000..619c56180b --- /dev/null +++ b/test/scaladoc/run/t4922.check @@ -0,0 +1 @@ +Done. diff --git a/test/scaladoc/run/t4922.scala b/test/scaladoc/run/t4922.scala new file mode 100644 index 0000000000..bce87ac980 --- /dev/null +++ b/test/scaladoc/run/t4922.scala @@ -0,0 +1,32 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + + // Test code + override def code = """ + // This the default values should be displayed + + object Test { + def f (a: Any = "".isEmpty) = () + def g[A](b: A = null) = () + } + """ + + // no need for special settings + def scaladocSettings = "" + + def testModel(rootPackage: Package) = { + // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) + import access._ + + val Test = rootPackage._object("Test") + val f = Test._method("f") + val g = Test._method("g") + + def assertEqual(s1: String, s2: String) = assert(s1 == s2, s1 + " == " + s2) + + assertEqual(f.valueParams(0)(0).defaultValue.get.expression, "\"\".isEmpty") + assertEqual(g.valueParams(0)(0).defaultValue.get.expression, "null") + } +} \ No newline at end of file -- cgit v1.2.3