https://psalm.dev/r/ea9ecf75b9
As we see in line 20, psalm correctly infers that $foo can be type list when checking with array_values
When using a custom assert function, it correctly asserts it, but reports a false positive DocblockTypeContradiction on the if condition in line 23
What actually happens here is, that it assumes that @psalm-assert type array<string, string> does not contain list<string> which is correct - however why does it report this as a DocblockTypeContradiction in the place where the function is called?
How can I assert if true => list<string>, if false => array<string, string>?