diff options
Diffstat (limited to 'test/scaladoc/resources')
-rw-r--r-- | test/scaladoc/resources/implicits-ambiguating-res.scala | 72 | ||||
-rw-r--r-- | test/scaladoc/resources/implicits-base-res.scala | 16 | ||||
-rw-r--r-- | test/scaladoc/resources/implicits-elimination-res.scala | 6 |
3 files changed, 9 insertions, 85 deletions
diff --git a/test/scaladoc/resources/implicits-ambiguating-res.scala b/test/scaladoc/resources/implicits-ambiguating-res.scala deleted file mode 100644 index 6ed51366cb..0000000000 --- a/test/scaladoc/resources/implicits-ambiguating-res.scala +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Test scaladoc implicits distinguishing -- supress all members by implicit conversion that are shadowed by the - * class' own members - * - * {{{ - * scala> class A { def foo(t: String) = 4 } - * defined class A - * - * scala> class B { def foo(t: Any) = 5 } - * defined class B - * - * scala> implicit def AtoB(a:A) = new B - * AtoB: (a: A)B - * - * scala> val a = new A - * a: A = A@28f553e3 - * - * scala> a.foo("T") - * res1: Int = 4 - * - * scala> a.foo(4) - * res2: Int = 5 - * }}} - */ -package scala.test.scaladoc.implicits.ambiguating -import language.implicitConversions // according to SIP18 - -/** - conv1-5 should be ambiguous - * - conv6-7 should not be ambiguous - * - conv8 should be ambiguous - * - conv9 should be ambiguous - * - conv10 and conv11 should not be ambiguous */ -class A[T] -/** conv1-9 should be the same, conv10 should be ambiguous, conv11 should be okay */ -class B extends A[Int] -/** conv1-9 should be the same, conv10 and conv11 should not be ambiguous */ -class C extends A[Double] - /** conv1-9 should be the same, conv10 should not be ambiguous while conv11 should be ambiguous */ -class D extends A[AnyRef] - -class X[T] { - def conv1: AnyRef = ??? - def conv2: T = ??? - def conv3(l: Int): AnyRef = ??? - def conv4(l: AnyRef): AnyRef = ??? - def conv5(l: AnyRef): String = ??? - def conv6(l: String)(m: String): AnyRef = ??? - def conv7(l: AnyRef)(m: AnyRef): AnyRef = ??? - def conv8(l: AnyRef): AnyRef = ??? - def conv9(l: String): AnyRef = ??? - def conv10(l: T): T = ??? - def conv11(l: T): T = ??? -} - -class Z[T] { - def conv1: AnyRef = ??? - def conv2: T = ??? - def conv3(p: Int): AnyRef = ??? - def conv4(p: AnyRef): String = ??? - def conv5(p: AnyRef): AnyRef = ??? - def conv6(p: String, q: String): AnyRef = ??? - def conv7(p: AnyRef, q: AnyRef): AnyRef = ??? - def conv8(p: String): AnyRef = ??? - def conv9(p: AnyRef): AnyRef = ??? - def conv10(p: Int): T = ??? - def conv11(p: String): T = ??? -} - -object A { - implicit def AtoX[T](a: A[T]) = new X[T] - implicit def AtoZ[T](a: A[T]) = new Z[T] -} diff --git a/test/scaladoc/resources/implicits-base-res.scala b/test/scaladoc/resources/implicits-base-res.scala index d6c0332c10..65d7bdf67c 100644 --- a/test/scaladoc/resources/implicits-base-res.scala +++ b/test/scaladoc/resources/implicits-base-res.scala @@ -16,9 +16,8 @@ trait MyNumeric[R] * def convToManifestA(x: T) // pimpA7: with 2 constraints: T: Manifest and T <: Double * def convToMyNumericA(x: T) // pimpA6: with a constraint that there is x: MyNumeric[T] implicit in scope * def convToNumericA(x: T) // pimpA1: with a constraint that there is x: Numeric[T] implicit in scope - * def convToPimpedA(x: Bar[Foo[T]]) // pimpA5: no constraints, SHADOWED - * def convToPimpedA(x: S) // pimpA4: with 3 constraints: T = Foo[Bar[S]], S: Foo and S: Bar, SHADOWED - * def convToPimpedA(x: T) // pimpA0: with no constraints, SHADOWED + * def convToPimpedA(x: Bar[Foo[T]]) // pimpA5: no constraints + * def convToPimpedA(x: S) // pimpA4: with 3 constraints: T = Foo[Bar[S]], S: Foo and S: Bar * def convToTraversableOps(x: T) // pimpA7: with 2 constraints: T: Manifest and T <: Double * // should not be abstract! * }}} @@ -53,10 +52,9 @@ object A { * def convToManifestA(x: Double) // pimpA7: no constraints * def convToMyNumericA(x: Double) // pimpA6: (if showAll is set) with a constraint that there is x: MyNumeric[Double] implicit in scope * def convToNumericA(x: Double) // pimpA1: no constraintsd - * def convToPimpedA(x: Bar[Foo[Double]]) // pimpA5: no constraints, SHADOWED - * def convToPimpedA(x: Double) // pimpA0: no constraints, SHADOWED + * def convToPimpedA(x: Bar[Foo[Double]]) // pimpA5: no constraints * def convToTraversableOps(x: Double) // pimpA7: no constraints - * // should not be abstract! + * // should not be abstract! * }}} */ class B extends A[Double] @@ -70,8 +68,7 @@ object B extends A * def convToIntA(x: Int) // pimpA2: no constraints * def convToMyNumericA(x: Int) // pimpA6: (if showAll is set) with a constraint that there is x: MyNumeric[Int] implicit in scope * def convToNumericA(x: Int) // pimpA1: no constraints - * def convToPimpedA(x: Int) // pimpA0: no constraints, SHADOWED - * def convToPimpedA(x: Bar[Foo[Int]]) // pimpA5: no constraints, SHADOWED + * def convToPimpedA(x: Bar[Foo[Int]]) // pimpA5: no constraints * }}} */ class C extends A[Int] @@ -84,8 +81,7 @@ object C extends A * {{{ * def convToMyNumericA(x: String) // pimpA6: (if showAll is set) with a constraint that there is x: MyNumeric[String] implicit in scope * def convToNumericA(x: String) // pimpA1: (if showAll is set) with a constraint that there is x: Numeric[String] implicit in scope - * def convToPimpedA(x: Bar[Foo[String]]) // pimpA5: no constraints, SHADOWED - * def convToPimpedA(x: String) // pimpA0: no constraints, SHADOWED + * def convToPimpedA(x: Bar[Foo[String]]) // pimpA5: no constraints * }}} */ class D extends A[String] diff --git a/test/scaladoc/resources/implicits-elimination-res.scala b/test/scaladoc/resources/implicits-elimination-res.scala index 5f7135c9e8..b23667440c 100644 --- a/test/scaladoc/resources/implicits-elimination-res.scala +++ b/test/scaladoc/resources/implicits-elimination-res.scala @@ -2,13 +2,13 @@ * Testing scaladoc implicits elimination */ package scala.test.scaladoc.implicits.elimination { - + import language.implicitConversions // according to SIP18 /** No conversion, as B doesn't bring any member */ class A class B { class C; trait V; type T; } - object A { - implicit def toB(a: A): B = null + object A { + implicit def toB(a: A): B = null } } |