-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Description
π Search Terms
never nullish parenthesis
π Version & Regression Information
- This changed between versions 5.8 and 5.9
β― Playground Link
π» Code
const x: { y: string | undefined } | undefined = undefined as any;
const foo = x?.y ?? `oops` ?? "";
const bar = (x?.y ?? `oops`) ?? "";
console.log(foo);
console.log(bar);π Actual behavior
Error on foo's expression, no error on bar's.
π Expected behavior
Error on both; both expressions are guaranteed to be "oops".
Additional information about the issue
No response
phillipbCopilot