-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#229Description
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
<?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);
}
}
https://phpstan.org/r/a5df5f9a-1be8-441d-8643-165916ddf7c7
Expected output
No error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels