Skip to content

Wildcard types are not properly inferred in pattern matching #13998

Closed
@Atry

Description

@Atry

Compiler version

3.1.0

Minimized code

val as: Array[_ <: Seq[String]] = Array(Seq("text"))

as match {
  case Array(Seq(text)) =>
    text.length
  case _ =>
}

Output

It does not compile

value length is not a member of Any

Expectation

It should compile

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions