-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Labels
Milestone
Description
/**
* @template T
*/
class Stringer {
/**
* @param T $t
*/
public static function takesParam($t) : string {
return "hello";
}
}
class AParent {}
class A extends AParent {}
/**
* @template-extends Stringer<A>
*/
class AStringer extends Stringer {
public static function foo() : string {
return parent::takesParam("should not be allowed");
}
}Expected output
Argument 1 of Stringer::takesParam expects A, string provided
Actual output
No issue - https://phpstan.org/r/c58ef371-1108-4e75-ae3b-b4f9a077ec69
Reactions are currently unavailable