Skip to content

Fix: skip choice flattening for primitive variant types#99

Merged
ryukzak merged 1 commit intomainfrom
fix/skip-primitive-choice-flattening
Mar 5, 2026
Merged

Fix: skip choice flattening for primitive variant types#99
ryukzak merged 1 commit intomainfrom
fix/skip-primitive-choice-flattening

Conversation

@ryukzak
Copy link
Copy Markdown
Collaborator

@ryukzak ryukzak commented Mar 5, 2026

  • Skip choice type flattening when the constrained variant is a primitive type (boolean, string, etc.)
  • Intersecting an object type (Omit<Extension, ...>) with a primitive (& boolean) produces invalid TypeScript (TS2352)
  • Affected profiles (e.g. Norge R4 SfmpllInformation) now keep the explicit value[x] field instead of flattening

Intersecting an object type with a primitive (boolean, string) produces
nonsensical TypeScript. Skip flattening when the constrained choice
variant is a primitive type — those slices keep the explicit value[x] field.
@ryukzak ryukzak merged commit 3b713ac into main Mar 5, 2026
31 checks passed
@ryukzak ryukzak deleted the fix/skip-primitive-choice-flattening branch March 5, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant