Skip to content

Commit

Permalink
Address code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
tmke8 committed Feb 23, 2022
1 parent 985f464 commit 74be938
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,16 +813,16 @@ def analyze_overloaded_func_def(self, defn: OverloadedFuncDef) -> None:
# We know this is an overload def. Infer properties and perform some checks.
self.process_final_in_overload(defn)
self.process_static_or_class_method_in_overload(defn)
if defn.impl:
self.process_overload_impl(defn)
self.process_overload_impl(defn)

def process_overload_impl(self, defn: OverloadedFuncDef) -> None:
"""Set flags for an overload implementation.
Currently, this checks for a trivial body in protocols classes,
where it makes the method implicitly abstract.
"""
assert defn.impl is not None
if defn.impl is None:
return
impl = defn.impl if isinstance(defn.impl, FuncDef) else defn.impl.func
if is_trivial_body(impl.body) and self.is_class_scope() and not self.is_stub_file:
assert self.type is not None
Expand Down

0 comments on commit 74be938

Please sign in to comment.