(self, defn: FuncItem)
| 1663 | arg.initializer.accept(self) |
| 1664 | |
| 1665 | def analyze_function_body(self, defn: FuncItem) -> None: |
| 1666 | is_method = self.is_class_scope() |
| 1667 | fullname = self.function_fullname(defn.fullname) |
| 1668 | with self.tvar_scope_frame(self.tvar_scope.method_frame(fullname)): |
| 1669 | # Bind the type variables again to visit the body. |
| 1670 | if defn.type: |
| 1671 | a = self.type_analyzer() |
| 1672 | typ = defn.type |
| 1673 | assert isinstance(typ, CallableType) |
| 1674 | a.bind_function_type_variables(typ, defn) |
| 1675 | for i in range(len(typ.arg_types)): |
| 1676 | store_argument_type(defn, i, typ, self.named_type) |
| 1677 | self.function_stack.append(defn) |
| 1678 | with self.enter(defn): |
| 1679 | for arg in defn.arguments: |
| 1680 | self.add_local(arg.variable, defn) |
| 1681 | |
| 1682 | # The first argument of a non-static, non-class method is like 'self' |
| 1683 | # (though the name could be different), having the enclosing class's |
| 1684 | # instance type. |
| 1685 | if is_method and defn.has_self_or_cls_argument and defn.arguments: |
| 1686 | if not defn.is_class: |
| 1687 | defn.arguments[0].variable.is_self = True |
| 1688 | else: |
| 1689 | defn.arguments[0].variable.is_cls = True |
| 1690 | |
| 1691 | defn.body.accept(self) |
| 1692 | self.function_stack.pop() |
| 1693 | |
| 1694 | def check_classvar_in_signature(self, typ: ProperType) -> None: |
| 1695 | t: ProperType |
no test coverage detected