diff --git a/tests/PHPStan/Analyser/NodeScopeResolverTest.php b/tests/PHPStan/Analyser/NodeScopeResolverTest.php index 0b01a18923..b34026b08c 100644 --- a/tests/PHPStan/Analyser/NodeScopeResolverTest.php +++ b/tests/PHPStan/Analyser/NodeScopeResolverTest.php @@ -731,6 +731,7 @@ public function dataFileAsserts(): iterable if (PHP_VERSION_ID >= 80100) { yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-6695.php'); + yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-6433.php'); } yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-6698.php'); diff --git a/tests/PHPStan/Analyser/data/bug-6433.php b/tests/PHPStan/Analyser/data/bug-6433.php new file mode 100644 index 0000000000..9a31de7ef1 --- /dev/null +++ b/tests/PHPStan/Analyser/data/bug-6433.php @@ -0,0 +1,21 @@ += 8.1 + +namespace Bug6433; + +use Ds\Set; +use function PHPStan\Testing\assertType; + +enum E: string { + case A = 'A'; + case B = 'B'; +} + +class Foo +{ + + function x(): void { + assertType('Ds\Set', new Set([E::A, E::B])); + } + +} +