diff --git a/src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php index fee2e529c..1bda8a338 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Block/DoAnalyzer.php @@ -31,6 +31,7 @@ class DoAnalyzer ): void { $do_context = clone $context; $do_context->break_types[] = 'loop'; + $do_context->inside_loop = true; $codebase = $statements_analyzer->getCodebase();