diff --git a/tests/IntersectionTypeTest.php b/tests/IntersectionTypeTest.php index ab54e57f1..655818067 100644 --- a/tests/IntersectionTypeTest.php +++ b/tests/IntersectionTypeTest.php @@ -115,6 +115,28 @@ final class IntersectionTypeTest extends TestCase 'assertions' => [], 'ignored_issues' => ['UnsafeInstantiation', 'MixedMethodCall'], ], + 'classStringOfCallableObjectEqualsObjectWithCallableIntersection' => [ + 'code' => ' $className + */ + function takesCallableObject(string $className): void { + $object = new $className(); + $object(); + } + + class Foo + { + public function __invoke(): void + { + } + } + + takesCallableObject(Foo::class); + ', + 'assertions' => [], + 'ignored_issues' => ['UnsafeInstantiation', 'MixedMethodCall'], + ], ]; }