mirror of
https://github.com/danog/psalm.git
synced 2024-12-04 10:38:49 +01:00
bugfix: allow non-single union types in assertions
fixes #5657 Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
parent
a9daa3ba02
commit
40971ff57d
@ -763,13 +763,14 @@ class CallAnalyzer
|
||||
$codebase
|
||||
);
|
||||
|
||||
if ($union->isSingle()) {
|
||||
if (!$union->hasMixed()) {
|
||||
foreach ($union->getAtomicTypes() as $atomic_type) {
|
||||
if ($assertion_type instanceof TTemplateParam
|
||||
&& $assertion_type->as->getId() === $atomic_type->getId()
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$assertion_rule = clone $assertion_rule;
|
||||
$assertion_rule->setAtomicType($atomic_type);
|
||||
$orred_rules[] = $assertion_rule;
|
||||
|
Loading…
Reference in New Issue
Block a user