summaryrefslogtreecommitdiff
path: root/test/files/neg/t7519.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-05-25 22:57:33 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-05-25 23:11:32 +0200
commit32b5d50d6635320f448c92c27bc6df3acbb04451 (patch)
tree37e0d0ba17d8ce535156f97e8574243b5ce851c7 /test/files/neg/t7519.scala
parent369f1f27ac6a27918e767e393dc6e22f7424aa38 (diff)
downloadscala-32b5d50d6635320f448c92c27bc6df3acbb04451.tar.gz
scala-32b5d50d6635320f448c92c27bc6df3acbb04451.tar.bz2
scala-32b5d50d6635320f448c92c27bc6df3acbb04451.zip
SI-7519 Less brutal attribute resetting in adapt fallback
Prefers `resetLocalAttrs` over `resetAllAttrs`. The latter loses track of which enclosing class of the given name is referenced by a `This` node which prefixes the an applied implicit view. The code that `resetAllAttrs` originally landed in: https://github.com/scala/scala/commit/d4c63b#L6R804
Diffstat (limited to 'test/files/neg/t7519.scala')
-rw-r--r--test/files/neg/t7519.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/neg/t7519.scala b/test/files/neg/t7519.scala
new file mode 100644
index 0000000000..aea0f35d8e
--- /dev/null
+++ b/test/files/neg/t7519.scala
@@ -0,0 +1,18 @@
+class C {
+ implicit def conversion(m: Int)(implicit nada: Nothing): String = ???
+
+ class C { // rename class to get correct error, can't find implicit: Nothing.
+ locally(0 : String) // was: "value conversion is not a member of C.this.C"
+ }
+}
+
+object Test2 {
+ trait T; trait U
+ new T {
+ implicit def conversion(m: Int)(implicit nada: Nothing): String = ???
+
+ new U { // nested anonymous classes also share a name.
+ locally(0 : String) // was: "value conversion is not a member of U"
+ }
+ }
+}