summaryrefslogtreecommitdiff
path: root/test/files/neg/t4270.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-06-04 19:59:51 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-06-10 09:38:32 +0200
commit9129cfe9117e41d44cda30222ffef22b70767cfb (patch)
tree0c1681dfd15ff66a19b895a0f36707750d4b870b /test/files/neg/t4270.scala
parent0dea3d5a05d838c9ad710cbcb14fbc6d83035851 (diff)
downloadscala-9129cfe9117e41d44cda30222ffef22b70767cfb.tar.gz
scala-9129cfe9117e41d44cda30222ffef22b70767cfb.tar.bz2
scala-9129cfe9117e41d44cda30222ffef22b70767cfb.zip
SI-4270 Disqualify in scope implicits that are shadowed.
If an expression wouldn't type check explicitly, it shouldn't be allowed implicitly. Employs typedIdent, which already does this sort of thing rather well, instead of continuing to reimplement it in Implicits. Remove check for non-implicit synonym, which is subsumed by typing an Ident. Workaround Scaladoc oddity, by using an attributed select when the context is deficient.
Diffstat (limited to 'test/files/neg/t4270.scala')
-rw-r--r--test/files/neg/t4270.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/files/neg/t4270.scala b/test/files/neg/t4270.scala
new file mode 100644
index 0000000000..2c7c71d8c2
--- /dev/null
+++ b/test/files/neg/t4270.scala
@@ -0,0 +1,6 @@
+object Test1 {
+ object A { implicit val x: Int = 1 }
+ import A.x
+ def x: Int = 0
+ implicitly[Int]
+}