1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Skip intersection of template types during inheritance check

This commit is contained in:
Daniil Gentili 2022-12-18 17:11:53 +01:00
parent 7d95f15e30
commit bccda92f31

View File

@ -768,8 +768,10 @@ class Methods
$candidate_type $candidate_type
); );
if ((!$old_contained_by_new && !$new_contained_by_old) if (((!$old_contained_by_new && !$new_contained_by_old)
|| ($old_contained_by_new && $new_contained_by_old) || ($old_contained_by_new && $new_contained_by_old))
&& !$candidate_type->hasTemplate()
&& !$overridden_storage->return_type->hasTemplate()
) { ) {
$attempted_intersection = null; $attempted_intersection = null;
if ($old_contained_by_new) { //implicitly $new_contained_by_old as well if ($old_contained_by_new) { //implicitly $new_contained_by_old as well