This is a duplicate of #20600, although I cannot reopen it. Here is an example to reproduce. I believe it was introduced in v1.20.0.
fromdataclassesimportdataclassfromtypingimportTypeGuard, Self@dataclassclassErrorCase:
x: intdef__eq__(self, other: object) ->TypeGuard[Self]:
return (
type(other)
istype(self)
) and (
self.x# error: "object" has no attribute "x"==other.x
)
The error on line 14 is a false-positive.
This is a duplicate of #20600, although I cannot reopen it. Here is an example to reproduce. I believe it was introduced in v1.20.0.
The error on line 14 is a false-positive.