Skip to content

Commit

Permalink
Try to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Apr 28, 2024
1 parent c0a9d04 commit d135a6f
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/Psalm/Internal/Type/TemplateInferredTypeReplacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,18 @@ private static function replaceConditional(
) {
$matching_if_types[] = $candidate_atomic_type;
} elseif (!UnionTypeComparator::isContainedBy(
$codebase,
$conditional_type,
new Union([$candidate_atomic_type]),
false,
false,
null,
false,
false,
)) {
$codebase,
$conditional_type,
new Union([$candidate_atomic_type]),
false,
false,
null,
false,
false,
)
&& ($candidate_atomic_type->getKey() !== 'string'
|| $conditional_type->getKey() !== 'string')
) {
$matching_else_types[] = $candidate_atomic_type;
}
}
Expand Down

0 comments on commit d135a6f

Please sign in to comment.