Skip to content

correct extrapolation for existential in contravariant position #4880

Open
@scabug

Description

@scabug
class O {
  class Y
  class U extends Y
  class A[-T] {def x(x: T) = 1}
  def foo[T >: U]: A[Y] forSome {type Y >: T} = new A[T]
  val g = foo
  g.x(new U)
  g.x(new Y) // <-- compiler error: found: O.this.Y required: T
}

Error requires some type T, however in this context there is no such type, so anyway this is a bug in description (but I think not only in description).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions