diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-12-10 12:46:13 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-12-10 13:10:52 +0100 |
commit | e249f2eeb8451c1b754711294ed954c8de7775fb (patch) | |
tree | 2a202ea255ec265cee3f343bd4b76e8443f767a4 /test/scaladoc/run | |
parent | 0acb8a30c379f268e8a3e1340504530493a1a1dc (diff) | |
download | scala-e249f2eeb8451c1b754711294ed954c8de7775fb.tar.gz scala-e249f2eeb8451c1b754711294ed954c8de7775fb.tar.bz2 scala-e249f2eeb8451c1b754711294ed954c8de7775fb.zip |
SI-4922 Show default in Scaladoc for generic methods.
We must account for cloned symbols.
Diffstat (limited to 'test/scaladoc/run')
-rw-r--r-- | test/scaladoc/run/t4922.check | 1 | ||||
-rw-r--r-- | test/scaladoc/run/t4922.scala | 32 |
2 files changed, 33 insertions, 0 deletions
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 |