Skip to content
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

Add @template-covariant support #34

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

arnaud-lb
Copy link
Contributor

No description provided.

@JanTvrdik
Copy link
Collaborator

That seems way too long. Why not extend the existing @template annotation to support in/out keywords (Kotlin) or +/- signs (Scala)?

/**
 * @template in T
 */

@ondrejmirtes
Copy link
Member

We need to support what's already in the wild. But we also plan to support @phpstan-generic<K, V> syntax and prefer it in the docs etc. See the discussion there (and feel free to contribute to it!): phpstan/phpstan#2527

@muglug
Copy link

muglug commented Nov 6, 2019

That seems way too long. Why not extend the existing @template annotation to support in/out keywords (Kotlin) or +/- signs (Scala)?

The reason I went with -covariant is that it seemed to me, as a newcomer to the idea, something that should be annotated fairly explicitly.

Also I felt out was confusing given by-ref parameters: vimeo/psalm#1603 (comment)

@ondrejmirtes ondrejmirtes merged commit 3edb515 into phpstan:master Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants