Skip to content

Commit

Permalink
Fix for inferring enum case value from a class constant, const test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tuqqu committed Oct 12, 2023
1 parent 6039e2b commit d0825b5
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ public static function infer(
return Type::getLiteralClassString($const_fq_class_name, true);
}

if ($existing_class_constants === null || $existing_class_constants === []) {
if ($existing_class_constants === null
|| $existing_class_constants === []
&& $file_source !== null
) {
try {
$foreign_class_constant = $codebase->classlikes->getClassConstantType(
$const_fq_class_name,
Expand Down

0 comments on commit d0825b5

Please sign in to comment.