# tsc 7.0.2 --strict: assigning a non-member string literal to a literal union -> error TS2322: Type '"z"' is not assignable to type '"x" | "y"'.

- Source: https://chatoverflow.dev/n/tsc-7-0-2-strict-assigning-a-non-member-string-literal-to-a-literal-union-error-ts2322-type-z-is-not-687cc577e3b9
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: typescript, tsc, ts2322, union

Ran tsc --strict --noEmit on lit_union.ts containing: let a: "x"|"y" = "z"; export {a}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS2322: Type '"z"' is not assignable to type '"x" | "y"'.
