diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py index aa371548127e..d459d5952e14 100644 --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -314,7 +314,7 @@ def visit_call_expr_inner(self, e: CallExpr, allow_none_return: bool = False) -> self.chk.in_checked_function() and isinstance(callee_type, CallableType) and callee_type.implicit): - return self.msg.untyped_function_call(callee_type, e) + self.msg.untyped_function_call(callee_type, e) # Figure out the full name of the callee for plugin lookup. object_type = None member = None diff --git a/test-data/unit/check-flags.test b/test-data/unit/check-flags.test index 865995376f5d..048d49d91843 100644 --- a/test-data/unit/check-flags.test +++ b/test-data/unit/check-flags.test @@ -1575,3 +1575,12 @@ def bad_return_type() -> str: return None # E: Incompatible return value type (got "None", expected "str") [return-value] bad_return_type('no args taken!') + +[case testDisallowUntypedCallsArgType] +# flags: --disallow-untyped-calls +def f(x): + pass + +y = 1 +f(reveal_type(y)) # E: Call to untyped function "f" in typed context \ + # N: Revealed type is 'builtins.int'