Get rid of make_simplified_union() except in error messages #8624
Labels
bug
mypy got something wrong
performance
priority-1-normal
refactoring
Changing mypy's internals
topic-union-types
It used to cause various issues and is still causing known bugs (like false negatives in per-file strict optional when
map_instance_to_supertype()
is involved). Ideally we should replace all calls to it (except in error message formatting code) withUnionType.make_union()
. Union constructor already flattens nested unions, we can also make it remove exact duplicates minimize perf impact.The text was updated successfully, but these errors were encountered: