Bind name expression to a symbol table node.
(self, expr: NameExpr, sym: SymbolTableNode)
| 5838 | self.bind_name_expr(expr, n) |
| 5839 | |
| 5840 | def bind_name_expr(self, expr: NameExpr, sym: SymbolTableNode) -> None: |
| 5841 | """Bind name expression to a symbol table node.""" |
| 5842 | if ( |
| 5843 | isinstance(sym.node, TypeVarExpr) |
| 5844 | and self.tvar_scope.get_binding(sym) |
| 5845 | and not self.allow_unbound_tvars |
| 5846 | ): |
| 5847 | self.fail(f'"{expr.name}" is a type variable and only valid in type context', expr) |
| 5848 | elif isinstance(sym.node, PlaceholderNode): |
| 5849 | self.process_placeholder(expr.name, "name", expr) |
| 5850 | else: |
| 5851 | expr.kind = sym.kind |
| 5852 | expr.node = sym.node |
| 5853 | expr.fullname = sym.fullname or "" |
| 5854 | |
| 5855 | def visit_super_expr(self, expr: SuperExpr) -> None: |
| 5856 | if not self.type and not expr.call.args: |
no test coverage detected