Skip to content

Do not set native type to mixed on annotation assignment #2017

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

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Nov 21, 2022

Not sure, but this looked weird to me. Or did I misunderstand it?

My shuffle tests started failing partly, but that makes sense to me because they were influencing each other and not cleanly separated. E.g. this should fix https://phpstan.org/r/20b7a14a-21e8-4e2e-aca7-c1119fc8528c

dang, this doesn't seem to fix any open issues, I was hoping it would, should have created one for my snippet 😅

CC @rajyan

@rajyan
Copy link
Contributor

rajyan commented Nov 21, 2022

Looks good to me!

I'm now thinking maybe making native type for assign variable required was not the right direction.
The purpose was to make native type exist in scope as full types too, so the variable certainty is handled correctly.

dang, this doesn't seem to fix any open issues

I think changing the type by @var after the first assign is a rather rare case? and treatPhpDocTypesAsCertain is not used that much currently.

@herndlm herndlm force-pushed the do-not-reset-native-type-to-mixed-on-annotation-assignment branch from 349bf41 to 96923dd Compare November 21, 2022 09:51
@ondrejmirtes
Copy link
Member

Thank you!

@herndlm herndlm deleted the do-not-reset-native-type-to-mixed-on-annotation-assignment branch November 24, 2022 16:10
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.

3 participants