summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t5354.check7
-rw-r--r--test/files/neg/t5354.scala15
2 files changed, 22 insertions, 0 deletions
diff --git a/test/files/neg/t5354.check b/test/files/neg/t5354.check
new file mode 100644
index 0000000000..e47cecb5fe
--- /dev/null
+++ b/test/files/neg/t5354.check
@@ -0,0 +1,7 @@
+t5354.scala:9: error: ambiguous implicit values:
+ both method x123 in package foo of type => foo.Bippy
+ and method z of type => foo.Bippy
+ match expected type foo.Bippy
+ implicitly[Bippy]
+ ^
+one error found
diff --git a/test/files/neg/t5354.scala b/test/files/neg/t5354.scala
new file mode 100644
index 0000000000..99b5650155
--- /dev/null
+++ b/test/files/neg/t5354.scala
@@ -0,0 +1,15 @@
+package object foo {
+ implicit def x123: Bippy = new Bippy("x")
+}
+package foo {
+ class Bippy(override val toString: String){ }
+ class Dingus {
+ def f1 = {
+ implicit def z: Bippy = new Bippy("z")
+ implicitly[Bippy]
+ }
+ }
+ object Test extends App {
+ println(new Dingus().f1)
+ }
+}