Open ilevkivskyi opened 4 years ago
Ideally there would be a test case to ensure #9169 won't happen again once the refactoring is done
I've noticed that make_simplified_union
has been modified several times since this issue opened:
last_known_value
by adding a helper func is_redundant_literal_instance
We probably need to reconsider the necessity and ways to refactor make_union
and make_simplified_union
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.