Skip to content

Do not report generic covariant issue without strict check#5437

Merged
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
VincentLanglet:genericStrictCheck
Apr 12, 2026
Merged

Do not report generic covariant issue without strict check#5437
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
VincentLanglet:genericStrictCheck

Conversation

@VincentLanglet
Copy link
Copy Markdown
Contributor

No description provided.

@VincentLanglet VincentLanglet marked this pull request as ready for review April 9, 2026 21:47
@phpstan-bot
Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

{
$this->checkTypeAgainstPhpDocType = true;
$this->strictWideningCheck = false;
$this->analyse([__DIR__ . '/data/generic-subtype.php'], []);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It'd be nice to come up with an example that would still be reported even here. Like Foo<int> vs. Foo<string>.

@ondrejmirtes
Copy link
Copy Markdown
Member

Nice, thank you, hopefully it fixes the issue in the tested project.

@ondrejmirtes ondrejmirtes merged commit 320298a into phpstan:2.1.x Apr 12, 2026
656 checks passed
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