diff --git a/src/Psalm/Checker/Statements/Block/ForeachChecker.php b/src/Psalm/Checker/Statements/Block/ForeachChecker.php index 007150380..6f98b0f31 100644 --- a/src/Psalm/Checker/Statements/Block/ForeachChecker.php +++ b/src/Psalm/Checker/Statements/Block/ForeachChecker.php @@ -198,6 +198,12 @@ class ForeachChecker } else { $value_type = Type::getMixed(); } + } elseif (ClassChecker::classImplements( + $project_checker, + $iterator_type->value, + 'Traversable' + )) { + // @todo try and get value type } else { if (IssueBuffer::accepts( new RawObjectIteration(