Open calvinalkan opened 2 years ago
I found these snippets:
Its not limited to closures.
I found these snippets:
Templates that are used in multiple parameters will automatically widen to accept the necessary types, so in both cases you really have class-string<Foo|Bar>
and Foo|Bar $class
. I think the best solution here is to fix Psalm so that using a template as a template constraint doesn't cause that automatic type widening so that you could do this, but someone needs to get around to implementing that.
Sort of related to #7549, I think both issues would be fixed by the solution I'm thinking of.
I found these snippets:
From my understanding of templates, this should throw an error.
https://psalm.dev/r/fbd9f9957c
Or is this the expected behavior?