diff --git a/tests/PHPStan/Rules/Classes/ImpossibleInstanceOfRuleTest.php b/tests/PHPStan/Rules/Classes/ImpossibleInstanceOfRuleTest.php index f62a3e1d0d..1e7b35b352 100644 --- a/tests/PHPStan/Rules/Classes/ImpossibleInstanceOfRuleTest.php +++ b/tests/PHPStan/Rules/Classes/ImpossibleInstanceOfRuleTest.php @@ -556,4 +556,15 @@ public function testNewIsAlwaysFinalClass(): void ]); } + public function testBug13469(): void + { + $this->treatPhpDocTypesAsCertain = false; + $this->analyse([__DIR__ . '/data/bug-13469.php'], [ + [ + 'Instanceof between Bug13469\Foo and Stringable will always evaluate to true.', + 23, + ], + ]); + } + } diff --git a/tests/PHPStan/Rules/Classes/data/bug-13469.php b/tests/PHPStan/Rules/Classes/data/bug-13469.php new file mode 100644 index 0000000000..89f73388ea --- /dev/null +++ b/tests/PHPStan/Rules/Classes/data/bug-13469.php @@ -0,0 +1,25 @@ +