someniatko
someniatko
It works "good enough" in the same sense `static` support works "good enough". This is still a bug, namespace != class name.
I'm following the official Psalm documentation, which should be the source of truth: > Used to mark a class, property or function as internal to **a given namespace** > (...)...
I find the new behavior more confusing though, than the currently documented one. At least it's harder to explain it.
The [original example](https://psalm.dev/r/0a4421aa23) from the issue still doesn't work: it says ``` Psalm\Exception\CodeException : InvalidArgument - src/somefile.php:27:38 - Argument 1 of takesIntToHolder expects Closure(int):Holder, but impure-Closure(int):Holder provided ```
Okay, so I managed to fix my exact case in the last commit, however it still feels like a hack and duplicated efforts. Needless to say it will suffer from...
Ok, however obviously I have even less vision than you do, by a lot. Each such fix for me is a debugging exercise, and frankly I only fix those problems...
> I'm up to merge this :) @orklah pingie 👉👈
Found a much easier reproducer: https://psalm.dev/r/428333f418 Basically it doesn't work properly if it doesn't find a static method in the class itself (e.g. if it's an inherited method)
@AndrolGenhald I found a fix for the "easier" reproducer (see the message above), but I'll need your help for fixing the original case. I'll submit a PR shortly.
> I think the issue boils down to this: https://psalm.dev/r/eb422e250d > > not allowing an immutable object to call an impure function, even though we know for a fact that...