Skip to content

Cannot pattern match an array with literals and spread #488

@cie

Description

@cie

This does not work:

module M {
  fun a(d : Array(Number)) : String {
    case (d) {
      [3, ...rest] => "ok"
      => "not ok"
    }
  }
}

Maybe it's not implemented, but the error message is misleading:

I was looking for the name of the field of a record to access but found ..rest] instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions