You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
False DocblockTypeContradiction on === between overlapping types (callable/string, callable/array, numeric/string, iterable/object) #13957
=== between two types that overlap but are not contained in each other reports a DocblockTypeContradiction, as if the types were disjoint. All four comparisons below can be true at runtime (the comment gives a value that is both types).
ERROR: DocblockTypeContradiction - 13:9 - string does not contain callable[impure]
ERROR: DocblockTypeContradiction - 14:9 - array<array-key, mixed> does not contain callable[impure]
ERROR: DocblockTypeContradiction - 15:9 - string does not contain numeric
ERROR: DocblockTypeContradiction - 16:9 - object does not contain iterable<mixed, int>
Expected: no issue. The intersections are callable-string, callable-array, numeric-string and Traversable<mixed, int>.
Type::intersectUnionTypes() returns null (no overlap) for these pairs: intersectAtomicTypes() has no rule for them and neither side is contained in the other. The === assertion (AssertionFinder) then reports the contradiction. The same function is used in other places (reconciliation, templates, method return types), so they get the same wrong "no overlap" result.
Activity
psalm-github-bot commentedon Nov 16, 2026
I found these snippets:
https://psalm.dev/r/3ed334d03a
Intersect callable, iterable, numeric, array-key and scalar through t…