Open
Description
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) with UnionType.make_union()
. Union constructor already flattens nested unions, we can also make it remove exact duplicates minimize perf impact.