-
Notifications
You must be signed in to change notification settings - Fork 550
Don't error with checkMissingCallableSignature: true about degraded closures
#4823
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: 2.1.x
Are you sure you want to change the base?
Conversation
|
We could raise the threshold to degenerate later.. need to test this in the origin slow snippets though |
|
An idea - we could degrade it only for literal array in code, but we wouldn't need to degrade it for array shapes? Meaning ConstantArrayTypeBuilder in TypeNodeResolver would be created in a different mode. Also maybe the limit for degrading closures could be higher? |
I don't see how this is possible, because the worst case scenario is built up over one assign per line |
|
I had to discard the previous fix because it discarded all perf benefits we got previosuly with #4684 |
|
This pull request has been marked as ready for review. |
| * isSameAs: \Closure(Scope, Node\Arg, Node\Arg): Node\Expr, | ||
| * isScalar: \Closure(Scope, Node\Arg): Node\Expr, | ||
| * isString: \Closure(Scope, Node\Arg): Node\Expr, | ||
| * isTrue: \Closure(Scope, Node\Arg): Node\Expr, |
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.
Please also assert what's the type of the property here.
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.
done
closes phpstan/phpstan#14012