summaryrefslogtreecommitdiff
path: root/test/scaladoc/resources/SI-4360.scala
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-07-12 14:24:54 +0200
committerVlad Ureche <vlad.ureche@gmail.com>2012-07-16 23:41:44 +0200
commita119ad1ae58723bd2e757ed331a536ff4ae49bdf (patch)
tree45692e87e13f0870f8b6f928b33ff6668cd46389 /test/scaladoc/resources/SI-4360.scala
parent891769fae541513d68ce7a8e84b7213472c333c9 (diff)
downloadscala-a119ad1ae58723bd2e757ed331a536ff4ae49bdf.tar.gz
scala-a119ad1ae58723bd2e757ed331a536ff4ae49bdf.tar.bz2
scala-a119ad1ae58723bd2e757ed331a536ff4ae49bdf.zip
SI-4360 Adds prefixes to scaladoc
This was a long-standing issue in scaladoc: It was unable to disambiguate between entries with the same name. One example is: immutable.Seq: trait Seq[+A] extends Iterable[A] with Seq[A] ... What's that? Seq extends Seq? No, immutable.Seq extends collection.Seq, but scaladoc was unable to show that. Now it does, depending on the template you're in. Prefixes are relative and can go back: -scala.collection.Seq has subclasses *immutable.Seq* and *mutable.Seq* -scala.immutable.Seq extends *collection.Seq* Unfortunately the price we pay for this is high, a 20% slowdown in scaladoc. This is why there is a new flag called -no-prefixes that disables the prefixes in front of types. Btw, it also fixes the notorious "booleanValue: This member is added by an implicit conversion from Boolean to Boolean ...". That's now java.lang.Boolean, so it becomes clear. Conflicts: src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala
Diffstat (limited to 'test/scaladoc/resources/SI-4360.scala')
-rw-r--r--test/scaladoc/resources/SI-4360.scala42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/scaladoc/resources/SI-4360.scala b/test/scaladoc/resources/SI-4360.scala
new file mode 100644
index 0000000000..8e8b96afd5
--- /dev/null
+++ b/test/scaladoc/resources/SI-4360.scala
@@ -0,0 +1,42 @@
+package scala.test.scaladoc.prefix {
+ package pack1 {
+
+ class A {
+ class Z
+ }
+
+ class B extends A
+
+ package a {
+ class C
+ }
+
+ package b {
+ class C
+ }
+
+ package c {
+ class C
+
+ class L extends pack2.Z
+
+ class TEST {
+ // test inherited classes
+ def fooCA(x: pack1.A#Z) = 1
+ def fooCB(x: pack1.B#Z) = 1
+ def fooCS(x: pack2.Z#Z) = 1
+ def fooCL(x: L#Z) = 1
+ // test in packages
+ def fooPA(x: pack1.a.C) = 1
+ def fooPB(x: pack1.b.C) = 1
+ def fooPC(x: pack1.c.C) = 1
+ }
+
+ class A extends pack1.A
+ }
+ }
+
+ package pack2 {
+ class Z extends pack1.A
+ }
+} \ No newline at end of file