mirror of
https://github.com/danog/psalm.git
synced 2024-12-12 09:19:40 +01:00
bugfix: single
does not mean that only one single atomic type is stored within a union
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
parent
3fd7a8b6d7
commit
0d96766640
@ -764,10 +764,13 @@ class CallAnalyzer
|
||||
);
|
||||
|
||||
if ($union->isSingle()) {
|
||||
$atomic_type = $union->getSingleAtomic();
|
||||
if (!$assertion_type instanceof TTemplateParam
|
||||
|| $assertion_type->as->getId() !== $atomic_type->getId()
|
||||
) {
|
||||
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