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

generics: fix position variance of readonly-by-phpdoc properties #2337

Conversation

jiripudil
Copy link
Contributor

/**
* @template-covariant Value of string|list<string>
*
* @immutable
Copy link
Contributor

@staabm staabm Apr 11, 2023

Choose a reason for hiding this comment

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

I think this needs another test-case with a @readonly-phpdoc property on a non-immutable class

seems this is working as expected already: https://phpstan.org/r/c1a29fdf-09c7-4500-a7c8-87a64de4ef9f

@ondrejmirtes ondrejmirtes merged commit 71b1ddc into phpstan:1.10.x Apr 11, 2023
368 of 378 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm
Copy link
Contributor

staabm commented Apr 11, 2023

thank you @jiripudil

@jiripudil jiripudil deleted the property-variance-for-readonly-by-phpdoc branch April 11, 2023 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants