diff --git a/tests/neg/implicitDivergenc.scala b/tests/neg/implicitDivergenc.scala new file mode 100644 index 000000000000..34828e9b1795 --- /dev/null +++ b/tests/neg/implicitDivergenc.scala @@ -0,0 +1,13 @@ +object Test { + class C[T] + implicit def fGen[T](implicit ev: T): C[T] = ??? + implicit def fString(implicit ev: C[Int]): C[String] = ??? + implicit def fInt: C[Int] = ??? + + implicitly[C[String]] + implicitly[C[C[String]]] + implicitly[C[C[C[String]]]] + implicitly[C[C[C[C[String]]]]] + implicitly[C[C[C[C[C[String]]]]]] + implicitly[C[C[C[C[C[C[String]]]]]]] // error: no implicit argument found (because of divergence) +} \ No newline at end of file