diff options
author | odersky <odersky@gmail.com> | 2016-12-15 17:44:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-15 17:44:06 +0100 |
commit | a5620ab882b95ef60acf42814ac5568d5f93bdd4 (patch) | |
tree | a524a250769cd72ebb316c30b8166c4c45d7fc43 /tests/neg | |
parent | 9f2b5ad068c06c62e28a3543218f5c1bc0362f74 (diff) | |
parent | bc869e74cb18ffdb4d42b59ad654f55403b9b6bd (diff) | |
download | dotty-a5620ab882b95ef60acf42814ac5568d5f93bdd4.tar.gz dotty-a5620ab882b95ef60acf42814ac5568d5f93bdd4.tar.bz2 dotty-a5620ab882b95ef60acf42814ac5568d5f93bdd4.zip |
Merge pull request #1785 from dotty-staging/fix-#1784
Fix #1784: allow to omit types for local implicit vals
Diffstat (limited to 'tests/neg')
-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..3bfe60434 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 // error: cyclic reference + x + } } |