-
Notifications
You must be signed in to change notification settings - Fork 653
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 way to annotate BackedEnum backing type #8268
Labels
Comments
|
I would think |
Both |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to be able to take a
BackedEnum<string> $enum
so that$enum->value
is definitely astring
. Currently I have false positives becauseBackedEnum::$value
isint|string
.BackedEnum
interface@enum<int>
maybe?)string
orint
, but you can't use@enum<positive-int>
withenum Foo: string
)case Bar = 0
should show an issue for@enum<positive-int>
)BackedEnum
template needs to be filled in from the@enum<[type]>
annotation so thatBackedEnum::from
,::tryFrom
, and::cases
use the correct typeThe text was updated successfully, but these errors were encountered: