callable(&int)
should not be a subtype of callable(int)
#8300
Labels
callable(&int)
should not be a subtype of callable(int)
#8300
Closure could still take its argument by reference though, and again mutate it. https://psalm.dev/r/3423b8e3e9
Originally posted by @someniatko in #8212 (comment)
@someniatko huh, you're right. I'd consider that a separate bug though. I think we need to add annotation for references in callables and make
callable(&int)
not be a subtype ofcallable(int)
, because the example I just gave crashes...Originally posted by @AndrolGenhald in #8212 (comment)
I don't believe we even have a way to annotate callables that take arguments by ref right now, so this is probably going to take a bit of work.
The text was updated successfully, but these errors were encountered: