summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@epfl.ch>2016-02-09 19:28:23 +0100
committerVlad Ureche <vlad.ureche@epfl.ch>2016-02-09 19:28:23 +0100
commitb0beb720e70cc8700a593766ad6c384e8826bf52 (patch)
tree785c080954d9e3db23834bb7e73026349ae969e9 /test
parent08dd102e002b38c7c3151c0c081ee0f902e3b918 (diff)
parentf2e0616f90f934689e4892358d56221504ad2a46 (diff)
downloadscala-b0beb720e70cc8700a593766ad6c384e8826bf52.tar.gz
scala-b0beb720e70cc8700a593766ad6c384e8826bf52.tar.bz2
scala-b0beb720e70cc8700a593766ad6c384e8826bf52.zip
Merge pull request #4952 from felixmulder/topic/scaladoc-hideImplicitConversions-tag
SI-9620: add doc annotation to hide specific conversions
Diffstat (limited to 'test')
-rw-r--r--test/scaladoc/run/SI-9620.check1
-rw-r--r--test/scaladoc/run/SI-9620.scala43
2 files changed, 44 insertions, 0 deletions
diff --git a/test/scaladoc/run/SI-9620.check b/test/scaladoc/run/SI-9620.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/SI-9620.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/SI-9620.scala b/test/scaladoc/run/SI-9620.scala
new file mode 100644
index 0000000000..96260aad9a
--- /dev/null
+++ b/test/scaladoc/run/SI-9620.scala
@@ -0,0 +1,43 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+ override def code = """
+ package a
+
+ trait Foo[S] {
+ def foo(t: S): Int = 123
+ }
+
+ /** Boo with only one foo method, hopefully!
+ * @hideImplicitConversion BooShouldNotAppearIsFoo
+ */
+ trait Boo[T]
+
+ object Boo {
+ sealed trait ShouldNotAppear
+ implicit class BooShouldNotAppearIsFoo(boo: Boo[ShouldNotAppear]) extends Foo[ShouldNotAppear]
+ implicit class BooLongIsFoo(boo: Boo[Long]) extends Foo[Long]
+ }
+ """
+
+ // no need for special settings
+ def scaladocSettings = "-implicits"
+
+ def testModel(rootPackage: Package) = {
+ import access._
+
+ // Assert Boo only has one implicit conversion
+ val boo = rootPackage._package("a")._trait("Boo")
+ val conversions = boo._conversions("a.Boo.BooShouldNotAppearIsFoo") ++ boo._conversions("a.Boo.BooLongIsFoo")
+ assert(conversions.length == 1, conversions.length + " == 1")
+
+ // Assert that the implicit conversion is not "BooShouldNotAppearIsFoo"
+ assert(conversions.head.conversionShortName == "BooLongIsFoo",
+ conversions.head.conversionShortName + " == BooLongIsFoo")
+
+ // Assert that the same for full path
+ assert(conversions.head.conversionQualifiedName == "a.Boo.BooLongIsFoo",
+ conversions.head.conversionQualifiedName + " == a.Boo.BooLongIsFoo")
+ }
+}