diff --git a/mypy/checker.py b/mypy/checker.py index ae93b8558add..a2b66b123aae 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -466,6 +466,13 @@ def check_overlapping_overloads(self, defn: OverloadedFuncDef) -> None: # At this point we should have set the impl already, and all remaining # items are decorators + if self.msg.errors.file in self.msg.errors.ignored_files: + # This is a little hacky, however, the quadratic check here is really expensive, this + # method has no side effects, so we should skip it if we aren't going to report + # anything. In some other places we swallow errors in stubs, but this error is very + # useful for stubs! + return + # Compute some info about the implementation (if it exists) for use below impl_type: Optional[CallableType] = None if defn.impl: