diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php index 723e1e3b5..aaaa127d7 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php @@ -1459,7 +1459,7 @@ class ClassLikeNodeScanner if (!isset($storage->enum_cases[$stmt->name->name])) { $case = new EnumCaseStorage( - $enum_value?->value, + $enum_value, $case_location, ); diff --git a/src/Psalm/Storage/EnumCaseStorage.php b/src/Psalm/Storage/EnumCaseStorage.php index ca9be915a..6d33895cf 100644 --- a/src/Psalm/Storage/EnumCaseStorage.php +++ b/src/Psalm/Storage/EnumCaseStorage.php @@ -1,18 +1,31 @@ value = $value; + $this->stmt_location = $location; } } diff --git a/src/Psalm/Type/UnionTrait.php b/src/Psalm/Type/UnionTrait.php index cd61607b7..8ae360076 100644 --- a/src/Psalm/Type/UnionTrait.php +++ b/src/Psalm/Type/UnionTrait.php @@ -1212,6 +1212,7 @@ trait UnionTrait /** * @psalm-mutation-free + * @psalm-suppress InvalidFalsableReturnType */ public function getSingleLiteral(): TLiteralInt|TLiteralString|TLiteralFloat {