diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t696.check | 10 | ||||
-rw-r--r-- | test/files/neg/t696.scala | 7 |
2 files changed, 11 insertions, 6 deletions
diff --git a/test/files/neg/t696.check b/test/files/neg/t696.check index ac26a864a5..b7bc5cdf98 100644 --- a/test/files/neg/t696.check +++ b/test/files/neg/t696.check @@ -1,5 +1,9 @@ -t696.scala:4: error: diverging implicit expansion for type TypeUtil0.Type[Any] +t696.scala:5: error: diverging implicit expansion for type TypeUtil0.Type[Any] starting with method WithType in object TypeUtil0 - as[Any](null); + as[Any](null) ^ -one error found +t696.scala:6: error: diverging implicit expansion for type TypeUtil0.Type[X] +starting with method WithType in object TypeUtil0 + def foo[X]() = as[X](null) + ^ +two errors found 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) } |