summaryrefslogtreecommitdiff
path: root/test/files/pos/sammy_overload.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/sammy_overload.scala')
-rw-r--r--test/files/pos/sammy_overload.scala27
1 files changed, 26 insertions, 1 deletions
diff --git a/test/files/pos/sammy_overload.scala b/test/files/pos/sammy_overload.scala
index 5472248f4d..6a3c88ec55 100644
--- a/test/files/pos/sammy_overload.scala
+++ b/test/files/pos/sammy_overload.scala
@@ -6,4 +6,29 @@ object Test {
def foo(x: String): Unit = ???
def foo(): Unit = ???
val f: Consumer[_ >: String] = foo
-} \ No newline at end of file
+}
+
+trait A[A, B] { def apply(a: A): B }
+
+class ArityDisambiguate {
+ object O {
+ def m(a: A[Int, Int]) = 0
+ def m(f: (Int, Int) => Int) = 1
+ }
+
+ O.m(x => x) // ok
+ O.m((x, y) => x) // ok
+}
+
+class InteractionWithImplicits {
+ object O {
+ class Ev
+ implicit object E1 extends Ev
+ implicit object E2 extends Ev
+ def m(a: A[Int, Int])(implicit ol: E1.type) = 0
+ def m(a: A[String, Int])(implicit ol: E2.type) = 1
+ }
+
+ O.m((x: Int) => 1) // ok
+ O.m((x: String) => 1) // ok
+}