Skip to content

fix: partial/required on tuple sequences (#1480)#1590

Open
drwpwrs wants to merge 2 commits intoarktypeio:mainfrom
drwpwrs:fix/1480-partial-tuples
Open

fix: partial/required on tuple sequences (#1480)#1590
drwpwrs wants to merge 2 commits intoarktypeio:mainfrom
drwpwrs:fix/1480-partial-tuples

Conversation

@drwpwrs
Copy link

@drwpwrs drwpwrs commented Feb 19, 2026

Fixes #1480

partial() and required() had no runtime effect on tuple sequences — only named properties were transformed. Type inference already handled tuples correctly via TS native Partial/Required, but the schema-level sequence was unchanged.

Adds optionalize() and require() methods to SequenceNode that convert between prefix/defaultable/optional element kinds. Defaultables get stripped to plain optionals (partial) or prefix (required). For required() this matches existing behavior where object defaults are stripped. For partial() this is necessary because the sequence model requires defaultables to precede optionals, so prefix elements can't become optional without also converting defaultables.

Sequences with postfix elements bail out since optionals+postfix is invalid in the sequence model.

.t assertion for defaultable tuples skipped due to #1160.

  • Code is up-to-date with the main branch
  • pnpm prChecks passing
  • New unit tests for partial/required on tuples (prefix-only, string syntax, defaultables)

@pullfrog
Copy link
Contributor

pullfrog bot commented Feb 19, 2026

Leaping into action...

Pullfrog  | View workflow run | Triggered by Pullfrogpullfrog.com𝕏

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

Labels

None yet

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

runtime check does not match inferred type of tuple with partial keyword applied

1 participant