Skip to content
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

overloaded method application error does not recognize disambiguation is futile #7040

Closed
scabug opened this issue Jan 29, 2013 · 2 comments
Closed

Comments

@scabug
Copy link

scabug commented Jan 29, 2013

It is trying to disambiguate one U from the other U, not noticing that it cannot do so without citing the method signature.

class A {
  def f[U <: Int](x: U): String = "1"
  def f[U <: Int](x: U)(implicit x1: String): String = "2"

  def g = f("a")
}
// a.scala:5: error: overloaded method value f with alternatives:
//   [U(in method f)(in method f)(in method f)(in method f)(in method f)(in method f)(in method f)(in method f) <: Int](x: U(in method f)(in method f)(in method f)(in method f)(in method f)(in method f)(in method f)(in method f))(implicit x1: String)String <and>
//   [U(in method f)(in method f)(in method f)(in method f)(in method f)(in method f)(in method f)(in method f) <: Int](x: U(in method f)(in method f)(in method f)(in method f)(in method f)(in method f)(in method f)(in method f))String
//  cannot be applied to (String)
//   def g = f("a")
//           ^
// one error found
@scabug
Copy link
Author

scabug commented Jan 29, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7040?orig=1
Reporter: @paulp

@scabug
Copy link
Author

scabug commented Aug 14, 2013

@retronym said (edited on Aug 14, 2013 10:46:34 PM UTC):
Closing as a duplicate of shinier #7752. Reporter is encouraged to review the proposed fix over in shiny-town.

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