mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix crash with @var
over echo
This commit is contained in:
parent
8611f99e09
commit
472c2839ad
@ -451,6 +451,7 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse
|
||||
|| $node instanceof PhpParser\Node\Stmt\Foreach_
|
||||
|| $node instanceof PhpParser\Node\Stmt\While_
|
||||
|| $node instanceof PhpParser\Node\Stmt\Do_
|
||||
|| $node instanceof PhpParser\Node\Stmt\Echo_
|
||||
) {
|
||||
if ($doc_comment = $node->getDocComment()) {
|
||||
$var_comments = [];
|
||||
|
@ -1168,6 +1168,11 @@ class AnnotationTest extends TestCase
|
||||
|
||||
function takesString(string $s): void {}'
|
||||
],
|
||||
'noCrashWithoutAssignment' => [
|
||||
'<?php
|
||||
/** @var DateTime $obj */
|
||||
echo $obj->format("Y");'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user