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
Allow typing things as scalar&!empty
?
#2449
Comments
muglug
added a commit
that referenced
this issue
Dec 9, 2019
Intersections of assertions should just be represented as separate /**
* @param mixed $value
* @psalm-assert scalar $value
* @psalm-assert !empty $value
*/
function assertScalarNotEmpty($value) : void {} That doesn't quite work in the current Psalm release, but I've just fixed things so it should: |
I missed this detail: will do another iteration on |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While trying to refine type annotations for
webmozart/assert
, I noticed that it is not currently possible to use intersection types together with theempty
construct.My attempt was to add
@psalm-assert string&!empty
(as an example), as well as other combinations ofempty
and!empty
, but theempty
and!empty
types seem to only be parsed when in a standalone context, and not in union/intersection types.The text was updated successfully, but these errors were encountered: