-
-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic with explicit argument as template type bound #2928
Comments
This type of bound is not supported yet, so the correct message should be something like this: https://phpstan.org/r/6c670ced-f96b-4903-a37b-fb57679f08a6 |
Hi, I'm thinking about implementing this. Can you outline the difference in behaviour between these two examples and why would you use the first one? Ideally show me some differences and expected output with /** @template E */
interface Foo {}
interface A {
/**
* @template T of Foo<string>
* @param T $a
*/
function x($a): void;
} And: /** @template E */
interface Foo {}
interface A {
/**
* @param Foo<string> $a
*/
function x($a): void;
} |
Implemented: phpstan/phpstan-src@e671cc0 Please test the hell out of this :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
Using generic type as template bound doesn't accept explicit generic argument.
https://phpstan.org/r/93677d60-da20-4a8f-b6c7-071e017ca6f4
Currently gives
Method A::x() has parameter $a with generic interface Foo but does not specify its types: E
The text was updated successfully, but these errors were encountered: