Skip to content

GADT matching doesn't brings subtyping relation into scope #9833

Closed
@IndiscriminateCoding

Description

@IndiscriminateCoding

Minimized code

object Main extends App:
  enum Extends[A, B]:
    case Ev[B, A <: B]() extends (A Extends B)

    def cast(a: A): B = this match {
      case Extends.Ev() => a
    }

Output

Found:    (a : A)
Required: B

Expectation

I expect A <: B to be visible inside Extends.Ev() case body

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions