From accaa314f3473553d9ffaff8c37e3c5b29f0f2e3 Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Tue, 19 Feb 2013 17:16:13 +0100 Subject: SI-7291: No exception throwing for diverging implicit expansion Since we don't throw exceptions for normal errors it was a bit odd that we don't do that for DivergingImplicit. As SI-7291 shows, the logic behind catching/throwing exception was broken for divergence. Instead of patching it, I rewrote the mechanism so that we now another SearchFailure type related to diverging expansion, similar to ambiguous implicit scenario. The logic to prevent diverging expansion from stopping the search had to be slightly adapted but works as usual. The upside is that we don't have to catch diverging implicit for example in the presentation compiler which was again showing that something was utterly broken with the exception approach. --- test/files/neg/t696.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/files/neg/t696.scala') diff --git a/test/files/neg/t696.scala b/test/files/neg/t696.scala index a06a32141a..ca76f7ef6c 100644 --- a/test/files/neg/t696.scala +++ b/test/files/neg/t696.scala @@ -1,6 +1,7 @@ object TypeUtil0 { - trait Type[+T]; + trait Type[+T] implicit def WithType[S,T](implicit tpeS : Type[S], tpeT : Type[T]) : Type[S with T] = null - as[Any](null); - def as[T](x : Any)(implicit tpe : Type[T]) = null; + def as[T](x : Any)(implicit tpe : Type[T]) = null + as[Any](null) + def foo[X]() = as[X](null) } -- cgit v1.2.3