Skip to content
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

Leverage conditional types #99

Merged
merged 1 commit into from
Dec 12, 2022
Merged

Conversation

greg0ire
Copy link
Member

This should help downstream projects stop wondering if null checks are necessary.

For instance, when I try running Psalm on doctrine/orm with 2.1.x@dev, at the moment I still get 100 errors despite #95 . A lot of them are about possibly null arguments, when the argument is $someToken['value'].

This should help downstream projects stop wondering if null checks are
necessary.
* : mixed
* )
* )
* )
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs: https://psalm.dev/docs/annotating_code/type_syntax/conditional_types/

I checked that it works with @psalm-trace in a test

@greg0ire greg0ire added this to the 2.1.0 milestone Dec 12, 2022
@greg0ire greg0ire merged commit 49e0c1c into doctrine:2.1.x Dec 12, 2022
@greg0ire greg0ire deleted the conditional-types branch December 12, 2022 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants