Skip to content

GADT pattern matching issue #6323

Closed
Closed
@sir-wabbit

Description

@sir-wabbit
sealed trait Foo[A]
final case class Bar[X]() extends Foo[List[X]]

def foo[A](foo: Foo[A], a: A): Int = foo match {
    case Bar() => a.length
}
-- [E008] Member Not Found Error: test.scala:7:24 ------------------------------
7 |        case Bar() => a.length
  |                      ^^^^^^^^
  |        value length is not a member of A
  |
  |        where:    A is a type in method foo which is an alias of List[A$1]
one error found

Possibly already part of #4076. Notice that the error message actually says that A = List[a]!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions