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 syntax for subtraction type #240

Draft
wants to merge 1 commit into
base: 1.23.x
Choose a base branch
from

Conversation

rvanvelzen
Copy link
Contributor

This is a preliminary syntax implementation for subtraction type syntax.

Merging now isn't necessary because the work in phpstan-src is far from done. Any feedback is still appreciated though.

@ondrejmirtes
Copy link
Member

  1. We have to get rid of all Type inheritance before this is possible to do: https://phpstan.org/blog/why-is-instanceof-type-wrong-and-getting-deprecated
  2. I'm not sure we need a new syntax for this and how it should look like. We could do this simply with subtract-from<X, Y> generics.

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.

None yet

2 participants