diff options
author | Vlad Ureche <vlad.ureche@gmail.com> | 2012-07-08 23:57:56 +0200 |
---|---|---|
committer | Vlad Ureche <vlad.ureche@gmail.com> | 2012-07-16 23:41:44 +0200 |
commit | 929415a3f4d5d6261d10cc6d28720c5241716bae (patch) | |
tree | 5d3f3e66415e63901730f1d2981a68cadb451436 /test/scaladoc/run/SI-3314.scala | |
parent | 8d0ea747c240e4881c057a78cf2c90e69369ca4b (diff) | |
download | scala-929415a3f4d5d6261d10cc6d28720c5241716bae.tar.gz scala-929415a3f4d5d6261d10cc6d28720c5241716bae.tar.bz2 scala-929415a3f4d5d6261d10cc6d28720c5241716bae.zip |
SI-4887 Link existentials in scaladoc
Based on an inital patch by Nada Amin. Rewrote some of the code to
compress it a bit.
Also fixed a problem that was affecting the prefix printing for
typerefs: type parameter and existentials won't get prefixes. While
I can imagine cases where you'd want to see where they come from,
you can always hover over them and see their origin.
Also added support for pretty-printing ThisTypes, SuperTypes and
SingleTypes (with links)
Diffstat (limited to 'test/scaladoc/run/SI-3314.scala')
-rw-r--r-- | test/scaladoc/run/SI-3314.scala | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/scaladoc/run/SI-3314.scala b/test/scaladoc/run/SI-3314.scala index 3b5c658078..fe220b08af 100644 --- a/test/scaladoc/run/SI-3314.scala +++ b/test/scaladoc/run/SI-3314.scala @@ -6,7 +6,7 @@ object Test extends ScaladocModelTest { override def resourceFile = "SI-3314.scala" // no need for special settings - def scaladocSettings = "" + def scaladocSettings = "-feature" def testModel(rootPackage: Package) = { // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) @@ -15,6 +15,10 @@ object Test extends ScaladocModelTest { // just need to check the member exists, access methods will throw an error if there's a problem val base = rootPackage._package("scala")._package("test")._package("scaladoc") + + + // test1 + val test1 = base._package("test1") val test1Value = test1._class("Enum")._method("Value").resultType assert(test1Value.name == "Value", test1Value.name + " == Value") @@ -26,6 +30,9 @@ object Test extends ScaladocModelTest { assert(test1Constants.refEntity(0)._1 == LinkToMember(test1._object("Constants")._class("Value"), test1._object("Constants")), test1Constants.refEntity(0)._1 + " == LinkToMember(test1.Enum.Value)") + + // test2 + val test2 = base._package("test2") def testDefinition(doc: DocTemplateEntity) = { for (day <- List("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")) { @@ -70,5 +77,15 @@ object Test extends ScaladocModelTest { testUsage(test2._object("UserObject")) testUsage(test2._class("UserClass")) testUsage(test2._trait("UserTrait")) + + + // test3 + val test3 = base._package("test3") + val foo = test3._method("foo") + assert(foo.valueParams(0)(0).resultType.name == "T", + foo.valueParams(0)(0).resultType.name + " == T") + val bar = test3._method("bar") + assert(bar.valueParams(0)(0).resultType.name == "(AnyRef { type Lambda[X] <: Either[A,X] })#Lambda[String]", + bar.valueParams(0)(0).resultType.name + " == (AnyRef { type Lambda[X] <: Either[A,X] })#Lambda[String]") } }
\ No newline at end of file |