Open egst opened 3 years ago
I found these snippets:
A possible workaround would be to introduce a dummy helper class with the second type definition and to import both types and only then perform the intersection on them.
I found these snippets:
A possible workaround would be to introduce a dummy helper class with the second type definition and to import both types and only then perform the intersection on them.
yet, it doesn't work if you try to use Q
within types or returns; or am I missing something here?
I found these snippets:
Error was clarified, intersections with array shapes are not supported
@orklah, but intersections with array shapes are supported, aren't they? It's just the intersections with imported array shape types that cause problems. And why would you actually not support intersections with imported types? It just feels like a natural thing. It's like if you could include a file in PHP bud you couldn't call included functions inside of other functions and the PHP developer's solution would be to just clarify the error that it is not supported.
You're right, I was confused, the basic version works, but here, the second example doesn't either: https://psalm.dev/r/9ddbcacb2f
The error is still kinda misleading. I'll flag this as enhancement
I found these snippets:
I just encountered this bug in a situation like https://psalm.dev/r/324fd96838
This shouldn't be too hard to fix, since it is working with the typeAlias last https://psalm.dev/r/89e0dffd1b
I found these snippets:
https://psalm.dev/r/ec2d56f41d
When I try to make an intersection type with an imported type, I get the following error:
Isn't
TKeyedArray
an object-like array? This seems like a bug to me, but maybe I'm not getting something right.