Skip to content

Unit-tuple pattern () not implemented ('tuple pattern requires tuple subject') #631

Closed

Description

@ehartford

Summary

Matching a unit tuple with a () pattern fails: match (): () => ... errors 'tuple pattern requires tuple subject'. §9.7.1.24 lists the unit-tuple pattern as a valid form.

Repro

fn main:
    match ():
        () => print("ok")

→ error: tuple pattern requires tuple subject

Found

Coverage sweep #518, 2026-07-03. The one-element (x,) form works (fixture spec_ss09_7_one_element_tuple_pattern landed); only the zero-element () form is unimplemented.

Activity

  1. ehartford commented on Jul 14, 2026

    @ehartford
    ContributorAuthor

    Fixed in 759667c. The unit pattern () was rejected because () is typed ty_void, not a zero-element tuple. Accepted it against a unit subject in check_pattern and in both MIR tuple-pattern lowerings (the Sema fix alone was insufficient — MIR lowering had the same rejection, caught by the behavior fixture). Verified: 'match (): () => print("ok")' now prints ok. Fixture: behav_match_unit_pattern. Full gate green.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions