Skip to content

Abstract type bound of type member is forgotten? #4884

Closed
@kory33

Description

@kory33
object Test {
  trait A
  trait TestConstructor1 { type F[_ <: A] }
  trait TestConstructor2[D] { type F[_ <: D] }

  val v1: TestConstructor1 => Unit = { f =>
    type P[a <: A] = f.F[a] // OK
  }

  val v2: TestConstructor2[A] => Unit = { f =>
    type P[a <: A] = f.F[a] // Error! Type argument a does not conform to upper bound D
  }
}

This compiles in Scala 2.12.1 and does not compile in Dotty 0.8.0. Just reporting this but I might have overlooked some dropped features.

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