@@ -192,7 +192,7 @@ def visit_or_pattern(self, o: OrPattern) -> PatternType:
192192 for capture_list in capture_types .values ():
193193 typ = UninhabitedType ()
194194 for _ , other in capture_list :
195- typ = join_types ( typ , other )
195+ typ = make_simplified_union ([ typ , other ] )
196196
197197 captures [capture_list [0 ][0 ]] = typ
198198
@@ -539,12 +539,12 @@ def visit_class_pattern(self, o: ClassPattern) -> PatternType:
539539 #
540540 type_info = o .class_ref .node
541541 if type_info is None :
542- return PatternType ( AnyType ( TypeOfAny . from_error ), AnyType (TypeOfAny .from_error ), {} )
543- if isinstance (type_info , TypeAlias ) and not type_info .no_args :
542+ typ : Type = AnyType (TypeOfAny .from_error )
543+ elif isinstance (type_info , TypeAlias ) and not type_info .no_args :
544544 self .msg .fail (message_registry .CLASS_PATTERN_GENERIC_TYPE_ALIAS , o )
545545 return self .early_non_match ()
546- if isinstance (type_info , TypeInfo ):
547- typ : Type = fill_typevars_with_any (type_info )
546+ elif isinstance (type_info , TypeInfo ):
547+ typ = fill_typevars_with_any (type_info )
548548 elif isinstance (type_info , TypeAlias ):
549549 typ = type_info .target
550550 elif (
0 commit comments