Commit c1131235 authored by Robert Bradshaw's avatar Robert Bradshaw

type narrowing for pxd files

parent cbd2a528
...@@ -1074,12 +1074,10 @@ class CClassScope(ClassScope): ...@@ -1074,12 +1074,10 @@ class CClassScope(ClassScope):
else: else:
if defining and entry.func_cname: if defining and entry.func_cname:
error(pos, "'%s' already defined" % name) error(pos, "'%s' already defined" % name)
if not entry.type.same_as(type, as_cmethod = 1): if type.narrower_c_signature_than(entry.type, as_cmethod = 1):
old_type = entry.type entry.type = type
if type.narrower_c_signature_than(entry.type, as_cmethod = 1): else:
entry.type = type error(pos, "Signature not compatible with previous declaration")
else:
error(pos, "Signature not compatible with previous declaration")
else: else:
if self.defined: if self.defined:
error(pos, error(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