Commit 8a3aa54b authored by Vitja Makarov's avatar Vitja Makarov

Don't remove optional args when function is overridable

parent 6cf7ea90
...@@ -1832,7 +1832,7 @@ class CFuncDefNode(FuncDefNode): ...@@ -1832,7 +1832,7 @@ class CFuncDefNode(FuncDefNode):
for arg in self.args: for arg in self.args:
if arg.default: if arg.default:
entry = scope.lookup(arg.name) entry = scope.lookup(arg.name)
if entry.cf_used: if self.overridable or entry.cf_used:
result = arg.calculate_default_value_code(code) result = arg.calculate_default_value_code(code)
code.putln('%s = %s;' % ( code.putln('%s = %s;' % (
arg.type.declaration_code(arg.cname), result)) arg.type.declaration_code(arg.cname), result))
...@@ -1849,7 +1849,7 @@ class CFuncDefNode(FuncDefNode): ...@@ -1849,7 +1849,7 @@ class CFuncDefNode(FuncDefNode):
for arg in self.args: for arg in self.args:
if arg.default: if arg.default:
entry = scope.lookup(arg.name) entry = scope.lookup(arg.name)
if entry.cf_used: if self.overridable or entry.cf_used:
code.putln('if (%s->%sn > %s) {' % code.putln('if (%s->%sn > %s) {' %
(Naming.optional_args_cname, (Naming.optional_args_cname,
Naming.pyrex_prefix, i)) Naming.pyrex_prefix, i))
......
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