-
-
Notifications
You must be signed in to change notification settings - Fork 51
Fix literal array key types false positive error #265
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
base: 1.x
Are you sure you want to change the base?
Conversation
mspirkov
left a comment
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.
Are you sure you don't want to wait for the second version, where this problem is solved?
|
Given the current rate of updates/development with nobody having time anymore for tooling (myself included if you look at the progress or lack thereof in psalm), it's probably going to be 2028 by the time the tools I need this for is updated to v2 (which again is mostly due to me not having time :-( Btw is "non-falsy-string" fixed in v2 too? |
|
I plan to add support for |
jaapio
left a comment
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.
This needs some tests. You can have a look at the other tests of type resolver to see how to do this. I cannot accept changes without a test.
| return $type instanceof String_ || | ||
| $type instanceof CallableString || | ||
| $type instanceof HtmlEscapedString || | ||
| $type instanceof IntegerRange || | ||
| $type instanceof IntegerValue || | ||
| $type instanceof IntMask || | ||
| $type instanceof IntMaskOf || | ||
| $type instanceof KeyOf || | ||
| $type instanceof LiteralString || | ||
| $type instanceof LowercaseString || | ||
| $type instanceof NegativeInteger || | ||
| $type instanceof NonEmptyLowercaseString || | ||
| $type instanceof NonEmptyString || | ||
| $type instanceof PositiveInteger || | ||
| $type instanceof StringValue || | ||
| $type instanceof ClassString || | ||
| $type instanceof InterfaceString || | ||
| $type instanceof TraitString || | ||
| $type instanceof Integer; |
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.
There is no need to include all of this, the string and integer type variants are extending the String_ or Integer class. The actual problem you solved is in the way you handle the compound type.
Fix #264