Bug report
Perhaps this is just a problem with the online playground (as Throwable is prevented), but...
Code snippet that reproduces the problem
namespace Foo;
class Bar {}
/**
* @template Bar of \DOMNode
*
* @param class-string<Bar> $foo
*/
function Foo(string $foo) : string {
return $foo;
}
https://phpstan.org/r/4e2bb93c-0397-488f-b58d-d0c146d0f1ea
Expected output
Cannot use Bar as template name since the class already exists