summaryrefslogtreecommitdiff
path: root/test/files/neg/t6667.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/t6667.scala')
-rw-r--r--test/files/neg/t6667.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/neg/t6667.scala b/test/files/neg/t6667.scala
new file mode 100644
index 0000000000..fb857ebd33
--- /dev/null
+++ b/test/files/neg/t6667.scala
@@ -0,0 +1,10 @@
+class C
+object C {
+ implicit def companion = new C
+}
+
+object Test {
+ implicit val inScope1, inScope2 = new C
+ implicitly[C]: Unit // C.companion was used; whereas the ambiguity should abort the implicit search.
+ implicitly[C] // ambiguity reported, rather than falling back to C.companion
+}