File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -283,7 +283,7 @@ public static function expandAtomic(
283283 $ declaring_fq_classlike_name = $ self_class ;
284284 }
285285
286- if (!($ evaluate_class_constants && $ codebase ->classOrInterfaceExists ($ declaring_fq_classlike_name ))) {
286+ if (!($ evaluate_class_constants && $ codebase ->classOrInterfaceOrEnumExists ($ declaring_fq_classlike_name ))) {
287287 return [$ return_type ];
288288 }
289289
Original file line number Diff line number Diff line change @@ -865,6 +865,25 @@ public function doesNotWork($_doesNotWork): void {
865865 }
866866 } ' ,
867867 ],
868+ 'importFromEnum ' => [
869+ 'code ' => <<<'PHP'
870+ <?php
871+ /** @psalm-type _Foo = array{foo: string} */
872+ enum E {}
873+ /**
874+ * @psalm-import-type _Foo from E
875+ */
876+ class C {
877+ /** @param _Foo $foo */
878+ public function f(array $foo): void {
879+ echo $foo['foo'];
880+ }
881+ }
882+ PHP,
883+ 'assertions ' => [],
884+ 'ignored_issues ' => [],
885+ 'php_version ' => '8.1 ' ,
886+ ],
868887 ];
869888 }
870889
You can’t perform that action at this time.
0 commit comments