1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 10:38:49 +01:00

bugfix: only override templated values in case of literals

This will avoid issues with invalid intersection assertions.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
Maximilian Bösing 2022-06-11 23:30:52 +02:00
parent 40971ff57d
commit 7c85e0c0d9
No known key found for this signature in database
GPG Key ID: 9A8988C93CEC81A3

View File

@ -763,7 +763,7 @@ class CallAnalyzer
$codebase
);
if (!$union->hasMixed()) {
if ($union->isSingle() || $union->allLiterals()) {
foreach ($union->getAtomicTypes() as $atomic_type) {
if ($assertion_type instanceof TTemplateParam
&& $assertion_type->as->getId() === $atomic_type->getId()