Commit b51cf45c authored by Robert Bradshaw's avatar Robert Bradshaw

Fix ticket #230, pxd cdef override for subclass methods

parent 2c748f0e
...@@ -1646,7 +1646,7 @@ class DefNode(FuncDefNode): ...@@ -1646,7 +1646,7 @@ class DefNode(FuncDefNode):
nogil = cfunc_type.nogil, nogil = cfunc_type.nogil,
visibility = 'private', visibility = 'private',
api = False, api = False,
directive_locals = cfunc.directive_locals) directive_locals = getattr(cfunc, 'directive_locals', {}))
def analyse_declarations(self, env): def analyse_declarations(self, env):
if 'locals' in env.directives: if 'locals' in env.directives:
......
...@@ -812,6 +812,9 @@ class AlignFunctionDefinitions(CythonTransform): ...@@ -812,6 +812,9 @@ class AlignFunctionDefinitions(CythonTransform):
def visit_DefNode(self, node): def visit_DefNode(self, node):
pxd_def = self.scope.lookup(node.name) pxd_def = self.scope.lookup(node.name)
if pxd_def: if pxd_def:
if self.scope.is_c_class_scope and len(pxd_def.type.args) > 0:
# The self parameter type needs adjusting.
pxd_def.type.args[0].type = self.scope.parent_type
if pxd_def.is_cfunction: if pxd_def.is_cfunction:
node = node.as_cfunction(pxd_def) node = node.as_cfunction(pxd_def)
else: else:
......
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