Open jrmajor opened 2 years ago
I found these snippets:
Think I'm running into the same or at least a closely related bug trying to coerce a dynamic type in a method.
I found these snippets:
@neclimdul That's a separate bug, it looks more like #4538.
I'm guessing these are all related as there seem to be a lot of template trait problems in psalm but I don't think my snippet is related to that issue. In hat issue the parameter type isn't getting the template type causing the method call to fail.
In the snipped I posted, the @var
explicit type doesn't get the template information similar to this issue. That said its actually and different rule failing in a different spot so its likely my example is yet another bug. Without digging into the code its hard to say for sure.
This issue is specifically about promoted properties, it's actually quite different from the issue you're having. There are indeed a lot of trait+template issues, but if none of them seem like a close match feel free to open a new one.
Template types are not recognized in
@var
annotated promoted properties. It works correctly with@param
annotations.https://psalm.dev/r/21a6833215