Skip to content

Match type does not check bounds #13741

Open
@bishabosha

Description

@bishabosha

Compiler version

Scala 3.1.1-RC1-bin-20211008-0a89c6f-NIGHTLY-git-0a89c6f

Minimized code

type Init[X <: NonEmptyTuple] <: Tuple = X match {
  case _ *: EmptyTuple => EmptyTuple
  case x *: xs => x *: Init[xs] // statically `xs` does not match, in practice it will not fail
}

Output

compiles ok

Expectation

A static failure for the recursive step as xs is not <: NonEmptyTuple, or is all checking left until a concrete type is applied?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions