Skip to content

Polymorphic overloads are sometimes hidden #4840

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 Jul 25, 2018 · 1 comment
Closed

Polymorphic overloads are sometimes hidden #4840

smarter opened this issue Jul 25, 2018 · 1 comment

Comments

@smarter
Copy link
Member

smarter commented Jul 25, 2018

This is a follow-up to #4819:

trait One[X]  {
  def concat(suffix: Int): X = ???
}

trait Two[Y <: Foo] {
  def concat[Dummy](suffix: Int): Y = ???
}

class Foo extends One[Foo] with Two[Foo] {
  concat(0) // OK

  // TODO: This does not typecheck because the polymorphic overload is masked
  // (we merge the denotations for both overloads into one and always prefer
  // MethodType to PolyType, instead we should return a MultiDenotation). See #4819.
  concat[Int](0) // error (that should actually not be an error)
}
@odersky
Copy link
Contributor

odersky commented Dec 16, 2018

Should be fixed by #5622.

@odersky odersky closed this as completed Dec 16, 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