Skip to content

Commit a0eb6ad

Browse files
Kunal SaliKunal Sali
authored andcommitted
fix type errors in checker.py discovered by self-check
1 parent 9cc4196 commit a0eb6ad

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

mypy/checker.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6249,15 +6249,16 @@ def conditional_callable_type_map(
62496249
if not current_type:
62506250
return {}, {}
62516251

6252-
if isinstance(get_proper_type(current_type), AnyType):
6252+
proper_type = get_proper_type(current_type)
6253+
if isinstance(proper_type, AnyType):
62536254
# Narrow Any to a generic callable type to satisfy no-any-return in strict mode.
62546255
return {
62556256
expr: CallableType(
6256-
[AnyType(TypeOfAny.from_another_any, source_any=current_type),
6257-
AnyType(TypeOfAny.from_another_any, source_any=current_type)],
6257+
[AnyType(TypeOfAny.from_another_any, source_any=proper_type),
6258+
AnyType(TypeOfAny.from_another_any, source_any=proper_type)],
62586259
[nodes.ARG_STAR, nodes.ARG_STAR2],
62596260
[None, None],
6260-
ret_type=AnyType(TypeOfAny.from_another_any, source_any=current_type),
6261+
ret_type=AnyType(TypeOfAny.from_another_any, source_any=proper_type),
62616262
fallback=self.named_type("builtins.function"),
62626263
is_ellipsis_args=True,
62636264
)

0 commit comments

Comments
 (0)