Commit 8e1f1ddf authored by Tom Niget's avatar Tom Niget

Fix recursion emission for nested functions

parent 0e8c5f1b
...@@ -85,6 +85,7 @@ class ExpressionVisitor(NodeVisitor): ...@@ -85,6 +85,7 @@ class ExpressionVisitor(NodeVisitor):
def visit_Name(self, node: ast.Name) -> Iterable[str]: def visit_Name(self, node: ast.Name) -> Iterable[str]:
res = self.fix_name(node.id) res = self.fix_name(node.id)
if self.scope.function and (decl := self.scope.get(res)) and decl.type is self.scope.function.obj_type: if self.scope.function and (decl := self.scope.get(res)) and decl.type is self.scope.function.obj_type:
if not self.scope.function.parent.function:
res = "(*this)" res = "(*this)"
#if decl.kind == VarKind.SELF: #if decl.kind == VarKind.SELF:
# res = "(*this)" # res = "(*this)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment