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

existential subtyping confuses typevars created by withTypeVars and others #11480

Open
adriaanm opened this Issue Apr 10, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@adriaanm
Copy link
Member

commented Apr 10, 2019

object Test extends App {
  class X[T]
  // expose bug with subtyping on existential types (in withTypeVars) with type params in their bounds
  def overloaded[T](b: X[T]) = println("Selected correct overload")
  def overloaded[T](b: X[_ <: T])(implicit bla: String = null) = ???
  overloaded(new X[String])
}
@adriaanm

This comment has been minimized.

Copy link
Member Author

commented Apr 10, 2019

currently, this would be considered ambiguous. In lampepfl/dotty#6230 there's a more elaborate example where the wrong overload is selected. It should be the first one (in both examples).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.