summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-05-28 05:29:27 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-05-28 05:29:27 -0700
commit3f290baa0fdd5e8a34dba698ba6d0b642a71d75d (patch)
tree186008d82541cad2b4d069e0d3d41892b3f2aada /test
parent6da73dd38d6dd7d8b463520bf54fc79975afc2a0 (diff)
parent8d4ce1da77bd6bf4a2311c9e30bd815a9aedae1b (diff)
downloadscala-3f290baa0fdd5e8a34dba698ba6d0b642a71d75d.tar.gz
scala-3f290baa0fdd5e8a34dba698ba6d0b642a71d75d.tar.bz2
scala-3f290baa0fdd5e8a34dba698ba6d0b642a71d75d.zip
Merge pull request #636 from retronym/ticket/5845
SI-5845 Advances the example from a crasher to an inference failure.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t5845.check7
-rw-r--r--test/files/neg/t5845.scala16
2 files changed, 23 insertions, 0 deletions
diff --git a/test/files/neg/t5845.check b/test/files/neg/t5845.check
new file mode 100644
index 0000000000..8c6100d6de
--- /dev/null
+++ b/test/files/neg/t5845.check
@@ -0,0 +1,7 @@
+t5845.scala:9: error: value +++ is not a member of Int
+ println(5 +++ 5)
+ ^
+t5845.scala:15: error: value +++ is not a member of Int
+ println(5 +++ 5)
+ ^
+two errors found
diff --git a/test/files/neg/t5845.scala b/test/files/neg/t5845.scala
new file mode 100644
index 0000000000..823c722c14
--- /dev/null
+++ b/test/files/neg/t5845.scala
@@ -0,0 +1,16 @@
+class Num[T] {
+ def mkOps = new Ops
+ class Ops { def +++(rhs: T) = () }
+}
+
+class A {
+ implicit def infixOps[T, CC[X] <: Num[X]](lhs: T)(implicit num: CC[T]) = num.mkOps
+ implicit val n1 = new Num[Int] { }
+ println(5 +++ 5)
+}
+
+class B {
+ implicit def infixOps[T, CC[X] <: Num[X]](lhs: T)(implicit num: CC[T]) : CC[T]#Ops = num.mkOps
+ implicit val n1 = new Num[Int] {}
+ println(5 +++ 5)
+}