summaryrefslogtreecommitdiff
path: root/test/files/neg/t6667.check
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-11-22 14:20:18 +0100
committerJason Zaugg <jzaugg@gmail.com>2012-11-26 21:46:40 +0100
commit9aa6ded8e01179e7d55144de273b39f3a0b2d3ec (patch)
tree4746ee626e95c54b4a1e7e0339afae68c60dc0ff /test/files/neg/t6667.check
parent3719f790f301852b85dcd95b401c921e286d4e1e (diff)
downloadscala-9aa6ded8e01179e7d55144de273b39f3a0b2d3ec.tar.gz
scala-9aa6ded8e01179e7d55144de273b39f3a0b2d3ec.tar.bz2
scala-9aa6ded8e01179e7d55144de273b39f3a0b2d3ec.zip
SI-6667 Abort after any ambiguous in-scope implicit
Rather than continuing on to a search of implicits of the expected type. Previously, the companion implicits were searched if the the caller was running the implicit search in silent mode, for example if searching for an implicit parameter in an application which has an expected type. After this commit, the behaviour is consistent, regardless on silent/non-silent typing.
Diffstat (limited to 'test/files/neg/t6667.check')
-rw-r--r--test/files/neg/t6667.check13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/neg/t6667.check b/test/files/neg/t6667.check
new file mode 100644
index 0000000000..43313fa4fe
--- /dev/null
+++ b/test/files/neg/t6667.check
@@ -0,0 +1,13 @@
+t6667.scala:8: error: ambiguous implicit values:
+ both value inScope1 in object Test of type => C
+ and value inScope2 in object Test of type => C
+ match expected type C
+ implicitly[C]: Unit // C.companion was used; whereas the ambiguity should abort the implicit search.
+ ^
+t6667.scala:9: error: ambiguous implicit values:
+ both value inScope1 in object Test of type => C
+ and value inScope2 in object Test of type => C
+ match expected type C
+ implicitly[C] // ambiguity reported, rather than falling back to C.companion
+ ^
+two errors found