Skip to content

Ambiguous overload error subsumed by misleading error #4536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
propensive opened this issue May 16, 2018 · 0 comments
Closed

Ambiguous overload error subsumed by misleading error #4536

propensive opened this issue May 16, 2018 · 0 comments
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug

Comments

@propensive
Copy link
Contributor

propensive commented May 16, 2018

Given this definition,

object Foo {
  def apply() = 1
  def apply()(implicit ord: Ordering[Int]) = 2
}

calling Foo() yields the error,

object Foo does not take parameters

whereas calling Foo.apply() reports the more useful,

Ambiguous overload. The overloaded alternatives of method apply in object Foo with types
 ()(implicit ord: Ordering[Int]): Int
 (): Int
both match arguments ()
@smarter smarter added itype:bug area:reporting Error reporting including formatting, implicit suggestions, etc labels May 16, 2018
odersky added a commit that referenced this issue Jan 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug
Projects
None yet
Development

No branches or pull requests

2 participants