From 32d14ed9928f04bdbd70b6381c5706024dfb4e70 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Mon, 19 Jun 2023 11:01:12 +0100 Subject: [PATCH] Delete a ProperType join hack (#15461) The tests added with this piece of code now pass even without it. It looks like the crash was properly fixed by https://github.com/python/mypy/pull/13371 --- mypy/join.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/mypy/join.py b/mypy/join.py index 62d256f4440f..f4af59f4e50b 100644 --- a/mypy/join.py +++ b/mypy/join.py @@ -29,7 +29,6 @@ Parameters, ParamSpecType, PartialType, - PlaceholderType, ProperType, TupleType, Type, @@ -246,14 +245,6 @@ def join_types(s: Type, t: Type, instance_joiner: InstanceJoiner | None = None) if isinstance(s, UninhabitedType) and not isinstance(t, UninhabitedType): s, t = t, s - # We shouldn't run into PlaceholderTypes here, but in practice we can encounter them - # here in the presence of undefined names - if isinstance(t, PlaceholderType) and not isinstance(s, PlaceholderType): - # mypyc does not allow switching the values like above. - return s.accept(TypeJoinVisitor(t)) - elif isinstance(t, PlaceholderType): - return AnyType(TypeOfAny.from_error) - # Meets/joins require callable type normalization. s, t = normalize_callables(s, t)