Skip to content

Pattern parser rejects .. rest-pattern in tuple-variant patterns (e.g. .NotFound(..)) #305

Closed

Description

@ehartford

Summary

The .. rest pattern is not accepted inside a tuple-style enum-variant pattern. It fails with expected pattern in both match and assert_matches.

Reproduction

enum DbError { NotFound(str, str) | Timeout }
fn main:
    let e = DbError.NotFound("a", "b")
    match e:
        .NotFound(..) => print("matched")   // error: expected pattern  (at `..`)
        _ => print("other")
error: expected pattern
 --> x.w:5:19
        .NotFound(..) => print("matched")
                  ^^

Explicit wildcards work: .NotFound(_, _) matches fine.

Notes

Env: with v0.13.1-g7104bb5d7, darwin-aarch64.

Activity

  1. added
    bug
    on May 30, 2026
  2. ehartford commented on Jun 1, 2026

    @ehartford
    ContributorAuthor

    Fixed in b2b2384. Tuple-variant .. rest patterns now parse, check, and lower, with positive and negative coverage. Verified by with build, with build :fixpoint, with build :test, and with build :install-user on pushed main (f5586c9).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions