Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add @template-covariant support #34

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

Merged
ondrejmirtes merged 1 commit into phpstan:master from arnaud-lb:template-covariant
Nov 7, 2019

Conversation

Copy link
Contributor

@arnaud-lb arnaud-lb commented Nov 6, 2019

No description provided.

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
 */
hrach reacted with thumbs up emoji

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

hrach reacted with confused emoji

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /