Treat ArrayType as covariant in its keys and values#2465
Merged
ondrejmirtes merged 2 commits intophpstan:1.10.xfrom Jun 17, 2023
Merged
Treat ArrayType as covariant in its keys and values#2465ondrejmirtes merged 2 commits intophpstan:1.10.xfrom
ondrejmirtes merged 2 commits intophpstan:1.10.xfrom
Conversation
Collaborator
|
You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x. |
d3d5390 to
d8ddfbc
Compare
d8ddfbc to
0673df9
Compare
Member
|
Is there a situation where the behaviour is different? Would be nice to have a test that fails without this change :) |
This should be safe because it is copy-on-write
0673df9 to
1cbd55b
Compare
Contributor
Author
|
Actually, there is. Added a test. It looks like edge cases, but I guess it could happen that this change introduces new errors for someone 😬 |
Member
|
I just checked the last PR that touched this: https://github.com/phpstan/phpstan-src/pull/30/files And looks like all the tests that were added back then still pass :) Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following up on #2464, I believe the implementation in ArrayType can be simplified accordingly