Skip to content

Commit c65c972

Browse files
authored
Always type check arguments when using --disallow-untyped-calls (#9510)
Fixes #9509.
1 parent be1a005 commit c65c972

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

mypy/checkexpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def visit_call_expr_inner(self, e: CallExpr, allow_none_return: bool = False) ->
317317
self.chk.in_checked_function() and
318318
isinstance(callee_type, CallableType)
319319
and callee_type.implicit):
320-
return self.msg.untyped_function_call(callee_type, e)
320+
self.msg.untyped_function_call(callee_type, e)
321321
# Figure out the full name of the callee for plugin lookup.
322322
object_type = None
323323
member = None

test-data/unit/check-flags.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,3 +1587,12 @@ def bad_return_type() -> str:
15871587
return None # E: Incompatible return value type (got "None", expected "str") [return-value]
15881588

15891589
bad_return_type('no args taken!')
1590+
1591+
[case testDisallowUntypedCallsArgType]
1592+
# flags: --disallow-untyped-calls
1593+
def f(x):
1594+
pass
1595+
1596+
y = 1
1597+
f(reveal_type(y)) # E: Call to untyped function "f" in typed context \
1598+
# N: Revealed type is 'builtins.int'

0 commit comments

Comments
 (0)