Skip to content

Bad interaction between overloading and implicit search #3168

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
allanrenucci opened this issue Sep 25, 2017 · 0 comments
Closed

Bad interaction between overloading and implicit search #3168

allanrenucci opened this issue Sep 25, 2017 · 0 comments

Comments

@allanrenucci
Copy link
Contributor

The following code snippet fails to compile with Dotty

object Test {
  class C {
    def foo(x: Int) = 1
    def foo(x: Double) = 2
  }

  implicit class COps(val x: C) {
    def foo(x: String) = 3
  }
  
  def test: Unit = {
    (new C).foo("Hello")
  }
}

The compiler is not able to find the method foo added via implicit conversion. If one of the overloaded version of foo is commented out, the code snippet compiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant