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
<?php/** * @template T of object * @template U of T */class A {
/** * @param U $o */publicfunctiondump(object$o): void
{
print_r($o);
}
}
interface B {}
interface C extends B {}
class D implements C {}
$d = newD();
/** @var A<B, C> */$a = newA();
$a->dump($d);
Psalm output (using commit a9f4148):
ERROR: InvalidTemplateParam - 25:1 - Extended template param U of A<B, C> expects type T:A as object, type C given
I would expect the following to work:
https://psalm.dev/r/0d2844a23d
Is this a supported use case?
The text was updated successfully, but these errors were encountered: