(self, o: FuncDef)
| 143 | self.record_line(imp.line, kind) |
| 144 | |
| 145 | def visit_func_def(self, o: FuncDef) -> None: |
| 146 | with self.enter_scope(o): |
| 147 | self.line = o.line |
| 148 | if len(o.expanded) > 1 and o.expanded != [o] * len(o.expanded): |
| 149 | if o in o.expanded: |
| 150 | print( |
| 151 | "{}:{}: ERROR: cycle in function expansion; skipping".format( |
| 152 | self.filename, o.line |
| 153 | ) |
| 154 | ) |
| 155 | return |
| 156 | for defn in o.expanded: |
| 157 | assert isinstance(defn, FuncDef) |
| 158 | self.visit_func_def(defn) |
| 159 | else: |
| 160 | if o.type: |
| 161 | assert isinstance(o.type, CallableType) |
| 162 | sig = o.type |
| 163 | arg_types = sig.arg_types |
| 164 | if sig.arg_names and sig.arg_names[0] == "self" and not self.inferred: |
| 165 | arg_types = arg_types[1:] |
| 166 | for arg in arg_types: |
| 167 | self.type(arg) |
| 168 | self.type(sig.ret_type) |
| 169 | elif self.all_nodes: |
| 170 | self.record_line(self.line, TYPE_ANY) |
| 171 | if not o.is_dynamic() or self.visit_untyped_defs: |
| 172 | super().visit_func_def(o) |
| 173 | |
| 174 | @contextmanager |
| 175 | def enter_scope(self, o: FuncDef) -> Iterator[None]: |
nothing calls this directly
no test coverage detected