ImpureMethodCall occurred for filling new "Ds\Set" with elements in method for class marked as immutable #10181
Unanswered
andrew-demb
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://psalm.dev/r/50506eccbe
ImpureMethodCall
is not expected for me, since I instantiate$references
withnew \Ds\Set()
just at the start of the method.Set::add
isn't pure, but mutates a new object initialized just now.Is it expected behavior in psalm for immutable method?
PS: I can't find the reason for the error
InvalidArgument
in the playground, but locally I haven't seen it.Beta Was this translation helpful? Give feedback.
All reactions