summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorSeth Tisue <seth@tisue.net>2015-10-27 08:48:46 -0400
committerSeth Tisue <seth@tisue.net>2015-10-27 08:48:46 -0400
commited2d7a1f3f776a3e49f66f3f0c7a4a3eb49f1443 (patch)
tree4d2167a7f2848cd9d16f22d82324e38f053db7e6 /test/files
parentd790277ee4a73ff09efb599fde88d3e408b239de (diff)
parentbb05881595f5734855bba8f419706d26da9563c7 (diff)
downloadscala-ed2d7a1f3f776a3e49f66f3f0c7a4a3eb49f1443.tar.gz
scala-ed2d7a1f3f776a3e49f66f3f0c7a4a3eb49f1443.tar.bz2
scala-ed2d7a1f3f776a3e49f66f3f0c7a4a3eb49f1443.zip
Merge pull request #4808 from retronym/ticket/9527
SI-9527 Fix NPE in ambiguous implicit error generation
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/t9527a.check7
-rw-r--r--test/files/neg/t9527a.scala8
-rw-r--r--test/files/neg/t9527b.check4
-rw-r--r--test/files/neg/t9527b.scala9
4 files changed, 28 insertions, 0 deletions
diff --git a/test/files/neg/t9527a.check b/test/files/neg/t9527a.check
new file mode 100644
index 0000000000..e756518bed
--- /dev/null
+++ b/test/files/neg/t9527a.check
@@ -0,0 +1,7 @@
+t9527a.scala:5: error: ambiguous implicit values:
+ both method f in class C of type (x: Int)String
+ and method g in class C of type (x: Int)String
+ match expected type Int => String
+ implicitly[Int => String]
+ ^
+one error found
diff --git a/test/files/neg/t9527a.scala b/test/files/neg/t9527a.scala
new file mode 100644
index 0000000000..35c58fc9a6
--- /dev/null
+++ b/test/files/neg/t9527a.scala
@@ -0,0 +1,8 @@
+class C {
+ implicit def f(x: Int): String = "f was here"
+ implicit def g(x: Int): String = "f was here"
+ def test: Unit = {
+ implicitly[Int => String]
+ }
+}
+
diff --git a/test/files/neg/t9527b.check b/test/files/neg/t9527b.check
new file mode 100644
index 0000000000..4529ec83ea
--- /dev/null
+++ b/test/files/neg/t9527b.check
@@ -0,0 +1,4 @@
+t9527b.scala:6: error: msg A=Nothing
+ implicitly[Int => String]
+ ^
+one error found
diff --git a/test/files/neg/t9527b.scala b/test/files/neg/t9527b.scala
new file mode 100644
index 0000000000..b40a4dca9e
--- /dev/null
+++ b/test/files/neg/t9527b.scala
@@ -0,0 +1,9 @@
+class C {
+ @annotation.implicitAmbiguous("msg A=${A}")
+ implicit def f[A](x: Int): String = "f was here"
+ implicit def g(x: Int): String = "f was here"
+ def test: Unit = {
+ implicitly[Int => String]
+ }
+}
+