Commit 77c95c8c authored by Robert Bradshaw's avatar Robert Bradshaw

Simplify call_self_node super() fix.

parent 1cd3478e
...@@ -2292,13 +2292,13 @@ class CFuncDefNode(FuncDefNode): ...@@ -2292,13 +2292,13 @@ class CFuncDefNode(FuncDefNode):
if omit_optional_args: if omit_optional_args:
args = args[:len(args) - self.type.optional_arg_count] args = args[:len(args) - self.type.optional_arg_count]
arg_names = [arg.name for arg in args] arg_names = [arg.name for arg in args]
# The @cname decorator may mutate this later. if is_module_scope:
func_cname = LazyStr(lambda: self.entry.func_cname) cfunc = ExprNodes.NameNode(self.pos, name=self.entry.name)
cfunc = ExprNodes.PythonCapiFunctionNode(self.pos, self.entry.name, func_cname, self.type) else:
# The entry is inspected due to self.type.is_overridable, but it type_entry = self.type.args[0].type.entry
# has the wrong self type. type_arg = ExprNodes.NameNode(self.pos, name=type_entry.name)
cfunc.entry = copy.copy(self.entry) type_arg.entry = type_entry
cfunc.entry.type = self.type cfunc = ExprNodes.AttributeNode(self.pos, obj=type_arg, attribute=self.entry.name)
skip_dispatch = not is_module_scope or Options.lookup_module_cpdef skip_dispatch = not is_module_scope or Options.lookup_module_cpdef
c_call = ExprNodes.SimpleCallNode( c_call = ExprNodes.SimpleCallNode(
self.pos, self.pos,
......
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