We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
empty optional property binding pattern destructuring element
Playground Link
declare function fn1({}?: { x: string }): void; // error declare function fn2({ x }?: { x: string }): void; // OK? declare function fn3([]?: [ x: string ]): void; // error declare function fn4([ x ]?: [ x: string ]): void; // OK?
An empty binding pattern gets the error Object is possibly 'undefined'., but a non-empty one doesn't.
Object is possibly 'undefined'.
Consistently no error; see also the discussion on #50707.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report
π Search Terms
empty optional property binding pattern destructuring element
π Version & Regression Information
β― Playground Link
Playground Link
π» Code
π Actual behavior
An empty binding pattern gets the error
Object is possibly 'undefined'.
, but a non-empty one doesn't.π Expected behavior
Consistently no error; see also the discussion on #50707.
The text was updated successfully, but these errors were encountered: