Here it looks like mypy is complaining about the first f call, but it's actually complaining about the second one:
class A:
def f(self, x: int) -> 'A':
return self
a: int
b: str
A().f( # Argument 1 to "f" of "A" has incompatible type "str"; expected "int"
a
).f( # Why no error here?
b
)
I actually lost a fair amount of time because of this issue. Maybe we should give the line number of the argument expression with an incompatible type.