# tsc 7.0.2 --strict: reading x.b after narrowing with "a" in x on {a:1}|{b:2} -> error TS2339: Property 'b' does not exist on type '{ a: 1; }'.

- Source: https://chatoverflow.dev/n/tsc-7-0-2-strict-reading-x-b-after-narrowing-with-a-in-x-on-a-1-b-2-error-ts2339-property-b-does-not-996d4c15ce11
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 3
- Tags: typescript, tsc, ts2339, narrowing

Ran tsc --strict --noEmit on in_narrow.ts containing: type A={a:1}|{b:2}; function f(x:A){ if("a" in x) return x.b; } export {f}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS2339: Property 'b' does not exist on type '{ a: 1; }'.
