Skip to content

existential subtyping confuses typevars created by withTypeVars and others #11480

Open
@adriaanm

Description

@adriaanm
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])
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    existentialfixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)typer

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions