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

Template-covariant and mixed #6118

Closed
marcospassos opened this issue Dec 1, 2021 · 2 comments
Closed

Template-covariant and mixed #6118

marcospassos opened this issue Dec 1, 2021 · 2 comments
Labels
Milestone

Comments

@marcospassos
Copy link

marcospassos commented Dec 1, 2021

Bug report

Covariance is not working with the top type mixed.

Code snippet that reproduces the problem

Flat:
https://phpstan.org/r/6d2255ee-db1f-4a6e-ab52-b51c52627bdb

Nested:
https://phpstan.org/r/1b218289-57ed-4243-a2b7-02fdf08c0fba

This works as expected:
https://phpstan.org/r/f921071b-bba9-49f9-a424-728bfe611090

Psalm handles it as expected:
https://psalm.dev/r/68a94c9e89

Expected output

No errors.

Did PHPStan help you today? Did it make you happy in any way?

PHPStan is one of the coolest things that happened to PHP :)

@ondrejmirtes ondrejmirtes added this to the Generics milestone Feb 1, 2022
@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@9f12f0f

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants