Skip to content

Commit

Permalink
Add test for #8373
Browse files Browse the repository at this point in the history
Undefined classes in function dockblocks should not crash psalm.
Test provided by @AndrolGenhald
  • Loading branch information
Daeroni committed Aug 8, 2022
1 parent fefd486 commit 89b7b32
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Template/ClassTemplateTest.php
Expand Up @@ -3826,6 +3826,22 @@ private function acceptA(A $_a): void
}
}',
],
'undefined class in function dockblock' => [
'<?php
/**
* @psalm-suppress UndefinedDocblockClass
*
* @param DoesNotExist<int> $baz
*/
function foobar(DoesNotExist $baz): void {}
/**
* @psalm-suppress UndefinedDocblockClass, UndefinedClass
* @var DoesNotExist
*/
$baz = new DoesNotExist();
foobar($baz);',
],
];
}

Expand Down

0 comments on commit 89b7b32

Please sign in to comment.