-
Notifications
You must be signed in to change notification settings - Fork 504
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
Implement template default types #1835
base: 1.9.x
Are you sure you want to change the base?
Conversation
b798793
to
1a41c5a
Compare
Feel free to rebase your PR without any Composer changes, I updated the parser on 1.9.x :) |
1a41c5a
to
269ed62
Compare
|
||
/** | ||
* @template T1 = true | ||
* @template T2 = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what syntax is for bound templates? Something like @template T of bool = true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@rvanvelzen Are you still interested in solving this? Having default values would be extremely handy! |
@ruudk I won't have time to work on this in the foreseeable future, but I do intend to solve this. That being said, anyone should feel free to take this over :) |
@rvanvelzen I need to tell you that I really miss your contributions :) Not just this specific one, but in general - a PR from you was always something to look forward to :) |
use function PHPStan\Testing\assertType; | ||
|
||
/** | ||
* @template T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@template T of Xxx
test should be added like in phpstan/phpstan#4801 (comment).
When of Xxx
is specified, it should be used as implicit default type.
Fixes phpstan/phpstan#4801