diff --git a/src/Psalm/Type/Atomic.php b/src/Psalm/Type/Atomic.php index 47d8e573ade..b0d456b65dd 100644 --- a/src/Psalm/Type/Atomic.php +++ b/src/Psalm/Type/Atomic.php @@ -210,6 +210,7 @@ public static function create( case 'non-empty-string': return new TNonEmptyString(); + case 'truthy-string': case 'non-falsy-string': return new TNonFalsyString(); diff --git a/tests/TypeCombinationTest.php b/tests/TypeCombinationTest.php index 1f3350f3bfb..60a857b6cfe 100644 --- a/tests/TypeCombinationTest.php +++ b/tests/TypeCombinationTest.php @@ -717,6 +717,13 @@ public function providerTestValidTypeCombination(): array 'non-empty-string' ] ], + 'combineTruthyStringAndNonEmptyString' => [ + 'non-empty-string', + [ + 'truthy-string', + 'non-empty-string' + ] + ], 'combineNonFalsyNonEmptyString' => [ 'non-empty-string', [