Skip to content

implicit view is not selected if a polymorphic method of the same name exists on the class #5408

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
smarter opened this issue Nov 8, 2018 · 2 comments

Comments

@smarter
Copy link
Member

smarter commented Nov 8, 2018

class E
class C {
  def foo[T <: E](t: T) = "C#foo"
}

object Test {
  implicit class D(val c: C) {
    def foo(x: Any) = "D#foo"
  }

  def test: Unit = {
    (new C).foo(0) // error: found: Int(0), required: E
  }
}

PR in scalac to fix this: scala/scala#7396 (I haven't investigated whether the root cause is the same).

@Jasper-M
Copy link
Contributor

Jasper-M commented Nov 8, 2018

See also #3769

@smarter
Copy link
Member Author

smarter commented Nov 8, 2018

Ah, closing this one as a duplicate of #3769 then.

@smarter smarter closed this as completed Nov 8, 2018
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

2 participants