Skip to content

Commit

Permalink
Fix self-check
Browse files Browse the repository at this point in the history
  • Loading branch information
ilevkivskyi committed Aug 4, 2024
1 parent 91c7e2a commit 92994db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mypy/typeanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,11 @@ def analyze_literal_type(self, t: UnboundType) -> Type:

def analyze_literal_param(self, idx: int, arg: Type, ctx: Context) -> list[Type] | None:
# This UnboundType was originally defined as a string.
if isinstance(arg, (UnboundType, UnionType)) and arg.original_str_expr is not None:
if (
isinstance(arg, ProperType)
and isinstance(arg, (UnboundType, UnionType))
and arg.original_str_expr is not None
):
assert arg.original_str_fallback is not None
return [
LiteralType(
Expand Down

0 comments on commit 92994db

Please sign in to comment.