mypy
mypy copied to clipboard
`no-untyped-call` false positive when calling lambda with no input parameters
from typing import Callable
(lambda: 1)() # no error
a = lambda: 1
b: Callable[[], int] = lambda: 1
reveal_type(a) # Revealed type is "def () -> builtins.int"
reveal_type(b) # Revealed type is "def () -> builtins.int"
a() # error: Call to untyped function (unknown) in typed context [no-untyped-call]
b() # no error
kinda related: #5069