summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/scaladoc/resources/SI-6509.scala24
-rw-r--r--test/scaladoc/run/SI-6509.check1
-rw-r--r--test/scaladoc/run/SI-6509.scala30
3 files changed, 55 insertions, 0 deletions
diff --git a/test/scaladoc/resources/SI-6509.scala b/test/scaladoc/resources/SI-6509.scala
new file mode 100644
index 0000000000..540ba243bd
--- /dev/null
+++ b/test/scaladoc/resources/SI-6509.scala
@@ -0,0 +1,24 @@
+package test.scaladoc.template.owners
+
+trait X {
+ /** @template */
+ type Symbol >: Null <: SymbolApi
+
+ /** @template */
+ type TypeSymbol >: Null <: Symbol with TypeSymbolApi
+
+ /** @template */
+ type TermSymbol >: Null <: Symbol with TermSymbolApi
+
+ /** @template */
+ type MethodSymbol >: Null <: TermSymbol with MethodSymbolApi
+
+ trait SymbolApi { this: Symbol => def x: Int}
+ trait TermSymbolApi extends SymbolApi { this: TermSymbol => def y: Int}
+ trait TypeSymbolApi extends SymbolApi { this: TypeSymbol => def z: Int}
+ trait MethodSymbolApi extends TermSymbolApi { this: MethodSymbol => def t: Int }
+}
+
+trait Y extends X
+trait Z extends Y
+trait T extends Z
diff --git a/test/scaladoc/run/SI-6509.check b/test/scaladoc/run/SI-6509.check
new file mode 100644
index 0000000000..3925a0d464
--- /dev/null
+++ b/test/scaladoc/run/SI-6509.check
@@ -0,0 +1 @@
+Done. \ No newline at end of file
diff --git a/test/scaladoc/run/SI-6509.scala b/test/scaladoc/run/SI-6509.scala
new file mode 100644
index 0000000000..3857949d14
--- /dev/null
+++ b/test/scaladoc/run/SI-6509.scala
@@ -0,0 +1,30 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+
+ override def resourceFile: String = "SI-6509.scala"
+
+ // 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 main = rootPackage._package("test")._package("scaladoc")._package("template")._package("owners")
+ val X = main._trait("X")
+ val Y = main._trait("Y")
+ val Z = main._trait("Z")
+ val T = main._trait("T")
+
+ def checkTemplateOwner(d: DocTemplateEntity) =
+ for (mbr <- List("Symbol", "TypeSymbol", "TermSymbol", "MethodSymbol")) {
+ val tpl = d._absTypeTpl(mbr).inTemplate
+ assert(tpl == X, tpl + " == X")
+ }
+
+ for (tpl <- List(X, Y, Z, T))
+ checkTemplateOwner(tpl)
+ }
+} \ No newline at end of file