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

Change impossible match arms to not contribute to the expressions' resulting union type #1515

Conversation

mad-briller
Copy link
Contributor

@mad-briller mad-briller commented Jul 15, 2022

Let me know if there's something i can do better!

went down the wrong rabbit hole for hours trying to modify the NodeScopeResolver, is there any docs / resources that would be good to learn about how scopes / type inference works internally @ondrejmirtes ? something like that video of Jan talking about types you posted the other day?

Verified

This commit was signed with the committer’s verified signature. The key has expired.
ondrejmirtes Ondřej Mirtes
…s resulting union type.
@ondrejmirtes ondrejmirtes force-pushed the change.impossible-match-arms-expression-result branch from b84a8ac to 189a466 Compare July 18, 2022 15:53
@ondrejmirtes ondrejmirtes merged commit 74228e6 into phpstan:1.8.x Jul 18, 2022
@ondrejmirtes
Copy link
Member

Thank you!

About the internals - you'll learn a lot by reading https://phpstan.org/developing-extensions/core-concepts and also maybe https://phpstan.org/writing-php-code/narrowing-types (narrowing types is implemented in TypeSpecifier class).

Other than that I'd recommend you to read release notes and see how various bugs are fixed around the codebase. Then try to fix a bug you choose :)

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.

None yet

3 participants