Skip to content

Commit 7a68d8d

Browse files
committed
Remove union simplification during inference
1 parent 715b768 commit 7a68d8d

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

mypy/constraints.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,6 @@ def _infer_constraints(
324324
template = get_proper_type(template)
325325
actual = get_proper_type(actual)
326326

327-
# Type inference shouldn't be affected by whether union types have been simplified.
328-
# We however keep any ErasedType items, so that the caller will see it when using
329-
# checkexpr.has_erased_component().
330-
if isinstance(template, UnionType):
331-
template = mypy.typeops.make_simplified_union(template.items, keep_erased=True)
332-
if isinstance(actual, UnionType):
333-
actual = mypy.typeops.make_simplified_union(actual.items, keep_erased=True)
334-
335327
# Ignore Any types from the type suggestion engine to avoid them
336328
# causing us to infer Any in situations where a better job could
337329
# be done otherwise. (This can produce false positives but that

0 commit comments

Comments
 (0)