diff options
Diffstat (limited to 'tests/neg/implicitDefs.scala')
-rw-r--r-- | tests/neg/implicitDefs.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/neg/implicitDefs.scala b/tests/neg/implicitDefs.scala index 1489344c8..3ec9796e8 100644 --- a/tests/neg/implicitDefs.scala +++ b/tests/neg/implicitDefs.scala @@ -8,4 +8,11 @@ object implicitDefs { implicit val x = 2 // error: type of implicit definition needs to be given explicitly implicit def y(x: Int) = 3 // error: result type of implicit definition needs to be given explicitly implicit def z(a: x.type): String = "" // error: implicit conversion may not have a parameter of singleton type + + def foo(implicit x: String) = 1 + + def bar() = { + implicit val x = foo + x + } } |