Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardTypeScriptcontrol-flow analysis pitfallsSingle-choice MCQ

Why does the property access fail despite the guard?

type Result = | { ok: true; value: number } | { ok: false; error: string }; function handle(getR: () => Result) { if (getR().ok) { getR().value; } }