From 2edf78f3a05112961ed6ad56452e9b5dc150fc3c Mon Sep 17 00:00:00 2001 From: Vlad Ureche Date: Thu, 11 Oct 2012 03:16:17 +0200 Subject: SI-6509 Correct @template owners --- test/scaladoc/resources/SI-6509.scala | 24 ++++++++++++++++++++++++ test/scaladoc/run/SI-6509.check | 1 + test/scaladoc/run/SI-6509.scala | 30 ++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 test/scaladoc/resources/SI-6509.scala create mode 100644 test/scaladoc/run/SI-6509.check create mode 100644 test/scaladoc/run/SI-6509.scala (limited to 'test') 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 -- cgit v1.2.3