We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
The isNull guard is not working for the nested nullable chain.
isNull
The following code should compile with the --strict flag.
--strict
function f(x: { foo: { bar: (string | undefined)[] | undefined } | undefined; }) { if (isNull(x.foo?.bar?.[0])) return; x.foo.bar[0].toLowerCase(); }
It throws the "Object is possibly 'undefined" error.
The text was updated successfully, but these errors were encountered:
Seems it's not possible for now: microsoft/TypeScript#34974
Sorry, something went wrong.
Fixed by microsoft/TypeScript#55613
No branches or pull requests
Describe the bug
The
isNull
guard is not working for the nested nullable chain.Expected behavior
The following code should compile with the
--strict
flag.Actual behavior
It throws the "Object is possibly 'undefined" error.
The text was updated successfully, but these errors were encountered: