diff --git a/src/Psalm/Internal/Type/TypeCombiner.php b/src/Psalm/Internal/Type/TypeCombiner.php index 5577a10ac29..ee1dd03cd27 100644 --- a/src/Psalm/Internal/Type/TypeCombiner.php +++ b/src/Psalm/Internal/Type/TypeCombiner.php @@ -1034,8 +1034,11 @@ private static function scrapeStringProperties( ) { // do nothing } elseif (isset($combination->value_types['string']) - && $combination->value_types['string'] instanceof TNonFalsyString - && $type->value + && $combination->value_types['string'] instanceof TNonEmptyString + && ($combination->value_types['string'] instanceof TNonFalsyString + ? $type->value + : $type->value !== '' + ) ) { // do nothing } else {