-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Optional chaining breaking function inference. #35274
New issue
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
Comments
This is quite bizarre. It would be understandable if there were some bug where it inferred different types based on the form of the expression passed to Since the type of |
Should be fixed by #34588 which is already available in |
Y'all know you can try "Nightly" in the Playground, right? Duplicate #34579 |
TypeScript Version: 3.7.2
Search Terms:
optional chaining
Code
Expected behavior:
const test
should be of typeMaybe<string>
likeconst test1
because this is the behavior of inference on a function with this signature.Actual behavior:
const test
is of typeMaybe<string | undefined
;The text was updated successfully, but these errors were encountered: