Skip to content

Commit

Permalink
Prevent crash on generic NamedTuple with unresolved typevar bound
Browse files Browse the repository at this point in the history
  • Loading branch information
sterliakov committed Feb 2, 2025
1 parent f44a60d commit fc2ab45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mypy/semanal_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ class HasPlaceholders(BoolTypeQuery):
def __init__(self) -> None:
super().__init__(ANY_STRATEGY)

def visit_tuple_type(self, t: TupleType, /) -> bool:
return super().visit_tuple_type(t) or t.partial_fallback.accept(self)

def visit_placeholder_type(self, t: PlaceholderType) -> bool:
return True

Expand Down

0 comments on commit fc2ab45

Please sign in to comment.