From 20bb5f196b4a05af244874c9bbba2a7ef9e71649 Mon Sep 17 00:00:00 2001 From: orklah Date: Mon, 4 Oct 2021 23:02:01 +0200 Subject: [PATCH] fix isAlwaysTruthy: TNonEmptyString can be falsy (with '0') --- src/Psalm/Type/Union.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Type/Union.php b/src/Psalm/Type/Union.php index 6185c7e457e..fecb487366e 100644 --- a/src/Psalm/Type/Union.php +++ b/src/Psalm/Type/Union.php @@ -1045,11 +1045,11 @@ public function isAlwaysTruthy(): bool continue; } - if ($atomic_type instanceof Type\Atomic\TNonEmptyString) { + if ($atomic_type instanceof Type\Atomic\TNonFalsyString) { continue; } - if ($atomic_type instanceof Type\Atomic\TNonEmptyNonspecificLiteralString) { + if ($atomic_type instanceof Type\Atomic\TCallableString) { continue; }