diff --git a/src/Psalm/Internal/Analyzer/TypeAnalyzer.php b/src/Psalm/Internal/Analyzer/TypeAnalyzer.php index bfc829865..386b751f4 100644 --- a/src/Psalm/Internal/Analyzer/TypeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/TypeAnalyzer.php @@ -1962,6 +1962,7 @@ class TypeAnalyzer $all_types_contain = false; } } elseif (!$input_type_part instanceof TIterable + && !$container_type_part instanceof TIterable && !$container_param->hasTemplate() && !$input_param->hasTemplate() ) { diff --git a/tests/Template/ClassTemplateExtendsTest.php b/tests/Template/ClassTemplateExtendsTest.php index d4c3b859b..004187cbf 100644 --- a/tests/Template/ClassTemplateExtendsTest.php +++ b/tests/Template/ClassTemplateExtendsTest.php @@ -2411,6 +2411,15 @@ class ClassTemplateExtendsTest extends TestCase $anInt = $maybe->extract(); }' ], + 'extendIterable' => [ + '> */ + public function provide() { + yield [1]; + } + }' + ], ]; }