Skip to content

Incorrect warning about erasure when matching against type alias A[X] = Array[X] #13167

@noresttherein

Description

@noresttherein

Reproduction steps

Scala version: 2.13.16

	type A[X] = scala.Array[X]
	(new A[A[String]](0) :Any) match {
		case _ :A[A[AnyRef]] => println("yes")
		case _               => println("no")
	}

Problem

non-variable type argument AnyRef in type pattern Array[Test.A[AnyRef]] (the underlying of Test.A[Test.A[AnyRef]]) is unchecked since it is eliminated by erasure
		case _ :A[A[AnyRef]] => println("yes")

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions