Skip to content

Wrong Type Mismatch Error "Type argument ... does not conform to upper bound" when referring to constructor type parameters #6561

Closed
@Sciss

Description

@Sciss

Tested in dotty 0.15.0-RC1.

The following works as expected:

trait Foo[V]
case class Inv[A](a: A)

trait Bar[K <: Foo[V], V] {
  type X = Inv[V]
  def test(): Bar[Foo[X], X]
}

But the following shows a strange compiler error:

trait Foo[V]
case class Inv[A](a: A)

trait Bar[K <: Foo[V], V] {
  // ERROR: Type argument Foo[Inv[V]] does not conform to upper bound Foo[Inv[Inv[V]]] 
  def test(): Bar[Foo[Inv[V]], Inv[V]]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions