aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2016-12-15 17:44:06 +0100
committerGitHub <noreply@github.com>2016-12-15 17:44:06 +0100
commita5620ab882b95ef60acf42814ac5568d5f93bdd4 (patch)
treea524a250769cd72ebb316c30b8166c4c45d7fc43 /tests/neg
parent9f2b5ad068c06c62e28a3543218f5c1bc0362f74 (diff)
parentbc869e74cb18ffdb4d42b59ad654f55403b9b6bd (diff)
downloaddotty-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.scala7
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
+ }
}