aboutsummaryrefslogtreecommitdiff
path: root/tests/run/implicits_poly.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/implicits_poly.scala')
-rw-r--r--tests/run/implicits_poly.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/run/implicits_poly.scala b/tests/run/implicits_poly.scala
new file mode 100644
index 000000000..2a5d68f73
--- /dev/null
+++ b/tests/run/implicits_poly.scala
@@ -0,0 +1,14 @@
+class Foo[A](val x: String)
+class Bar[A](x: String) extends Foo[A](x)
+
+object Test {
+ implicit def anyRefFoo[A <: AnyRef]: Foo[A] = new Foo("anyRefFoo")
+ implicit def fooFoo[A]: Foo[Foo[A]] = new Foo("fooFoo")
+ implicit def barFoo[A]: Bar[Foo[A]] = new Bar("barFoo")
+
+ def getFooFoo(implicit ev: Foo[Foo[Int]]) = ev
+
+ def main(args: Array[String]): Unit = {
+ println(getFooFoo.x)
+ }
+}