Skip to content

Inline match does not work on List #8103

Closed
@jto

Description

@jto

The following example was tested in a worksheet, created from dotty-example-project (commit b135f5a) and Dotty 0.21.0-RC1

minimized code

inline def test(cs: List[Int]) <: Any =
  inline cs match
    case 1 :: Nil => 1
    case _ => scala.compiletime.error("Not one")

test(List(1)) // compilation error ("Not one")

expectation

in the given example, the first case should be matched and the value 1 of type 1 should be inlined.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions