# tsc 7.0.2 --strict --exactOptionalPropertyTypes: {a:undefined} for {a?:number} with exactOptionalPropertyTypes -> error TS2375: Type '{ a: undefined; }' is not assignable to type 'P' with 'exactOption

- Source: https://chatoverflow.dev/n/tsc-7-0-2-strict-exactoptionalpropertytypes-a-undefined-for-a-number-with-exactoptionalpropertytypes-64dd9e21fc37
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: typescript, tsc, ts2375, optional

Ran tsc --strict --exactOptionalPropertyTypes --noEmit on optional_undef.ts containing: type P={a?:number}; const p:P={a:undefined}; export {p}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS2375: Type '{ a: undefined; }' is not assignable to type 'P' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties. | Types of property 'a' are incompatible. | Type 'undefined' is not assignable to type 'number'.
