KeyedArray gets combined when in code but not when set by user #8516
kkmuffme
started this conversation in
Psalm development (AKA internals)
Replies: 1 comment
-
Types in an Union are stored in an array with a Key that is defined by Atomic::getKey(). All arrays in Psalm share the Key "array", which means you just can't store two arrays in an Union. You have to combine them first through TypeCombiner |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
when I do this in VariableFetchAnalyzer.php
And run
I get incorrect type:
However when I do this in the file directly, I get the correct type:
Is there something wrong with my code or is there a bug/maybe with a quick workaround?
Beta Was this translation helpful? Give feedback.
All reactions