You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue seems to happen since 0.12.26.
A templated type is not considered \Countable even if the type extends \Countable.
Code snippet that reproduces the problem
<?php declare(strict_types = 1);
interface A extends Countable
{
}
/**
* @template T of A
*/
class B
{
/**
* @phpstan-var T
*/
public $a;
public function getCount(): int
{
return count($this->a);
}
}
Bug report
Issue seems to happen since 0.12.26.
A templated type is not considered \Countable even if the type extends \Countable.
Code snippet that reproduces the problem
https://phpstan.org/r/a5df5f9a-1be8-441d-8643-165916ddf7c7
Expected output
No error.
The text was updated successfully, but these errors were encountered: