-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
fix psalm issues #163
fix psalm issues #163
Conversation
something is weird about this error, it's been present for a while, but never caught in CI, it only happens locally, i assume you encountered this error as well because i can see it was added in your baseline here: https://github.com/muglug/psl/blob/1.6.x/psalm-baseline.xml#L4 |
Pull Request Test Coverage Report for Build 681082022
💛 - Coveralls |
|
||
<!-- Not using the result of pure functions is common within PSL --> | ||
<!-- e.g: with and Psl\invariant_violations() --> | ||
<UnusedFunctionCall errorLevel="suppress" /> |
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.
not sure if this should be considered a bug in psalm or not.
- pure function are considered to have no side effects
- calling a function with no side effects without using it's results is useless
- psalm consider throwing an exception not a side effect
- hacklang considers throwing an exception a side effect ( https://github.com/facebook/hhvm/blob/master/hphp/hack/doc/HIPs/contexts_and_coeffects.md )
- if throwing an exception is a side effect, this is most likey to result in all functions being non pure, as 90% of calls result in an exception
- if throwing an exception is not a side effect, how can a pure function tell psalm that it's okay not to use it's result?
wdyt @muglug?
/cc @Ocramius
Do you think |
I think I previously added those |
Yeah, I guess people can always suppress them |
No description provided.