diff --git a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php index 723e1e3b5c0..aaaa127d7a6 100644 --- a/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php +++ b/src/Psalm/Internal/PhpVisitor/Reflector/ClassLikeNodeScanner.php @@ -1459,7 +1459,7 @@ private function visitEnumDeclaration( 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 ca9be915aae..6d33895cf22 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 cd61607b7ba..8ae3600764e 100644 --- a/src/Psalm/Type/UnionTrait.php +++ b/src/Psalm/Type/UnionTrait.php @@ -1212,6 +1212,7 @@ public function isSingleLiteral(): bool /** * @psalm-mutation-free + * @psalm-suppress InvalidFalsableReturnType */ public function getSingleLiteral(): TLiteralInt|TLiteralString|TLiteralFloat {