From 6c946e6647e6c2e04e0926787aa2932c29473356 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 18 Jan 2019 17:30:55 +0100 Subject: [PATCH] Fix #4536: Add regression test --- compiler/test-resources/repl/i4536 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 compiler/test-resources/repl/i4536 diff --git a/compiler/test-resources/repl/i4536 b/compiler/test-resources/repl/i4536 new file mode 100644 index 000000000000..97326fb45852 --- /dev/null +++ b/compiler/test-resources/repl/i4536 @@ -0,0 +1,14 @@ +scala> object Foo { def apply() = 1; def apply()(implicit ord: Ordering[Int]) = 2; Foo() } +1 | object Foo { def apply() = 1; def apply()(implicit ord: Ordering[Int]) = 2; Foo() } + | ^^^ + |Ambiguous overload. The overloaded alternatives of method apply in object Foo with types + | ()(implicit ord: Ordering[Int]): Int + | (): Int + |both match arguments () +scala> object Foo { def apply() = 1; def apply()(implicit ord: Ordering[Int]) = 2; Foo.apply() } +1 | object Foo { def apply() = 1; def apply()(implicit ord: Ordering[Int]) = 2; Foo.apply() } + | ^^^^^^^^^ + |Ambiguous overload. The overloaded alternatives of method apply in object Foo with types + | ()(implicit ord: Ordering[Int]): Int + | (): Int + |both match arguments ()