psalm: Invalid argument type when using generic callables
I would expect the following snippet to run without any issues, yet it does: https://psalm.dev/r/2b1f17cd94
I have tested with dev-master
as well as with the latest release version.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 26 (12 by maintainers)
Please ask here, if you can find something weird or at least the code that handle this, we can try to help understand or give our input
Psalm seems to resolve both T (from current class and from new instance) the same way. For example, https://psalm.dev/r/677a7a05d1 does not produce issue because T from ArrayList2 is treated as totally unrelated to T from ArrayList