Skip to content

Fail to utilize HKT GADT bounds for applied types #13257

Closed
@Linyxus

Description

@Linyxus

Compiler version

3.0.1

Minimized code

type Const = [X] =>> Int

trait Expr[F[_]]
case class ConstExpr() extends Expr[Const]

def foo[F[_], A](e: Expr[F]): F[A] = e match
  case _: ConstExpr => 0

Output

Found:    (0 : Int)
Required: F[A]

where:    F is a type in method foo which is an alias of [X] =>> Int

Expectation

By pattern matching we derive the GADT bound F := [X] =>> Int (as shown in the error message), but during type comparison the compiler will not recognize F[X] == Int for the applied type.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions