Commit e507e03a authored by gsamain's avatar gsamain Committed by Xavier Thompson

Declare a default constructor only when there is no other one inherited

(if the class redefines a constructor with a compatible signature,
it will get overridden, so it effectively prevents the default
constructor from spawning when there may be an ambiguity)
parent 6915997c
......@@ -679,6 +679,7 @@ class Scope(object):
this_type = PyrexTypes.CPtrType(entry.type) if not cypclass else entry.type
scope.declare_var(name="this", cname="this", type=this_type, pos=entry.pos)
if cypclass:
if not scope.lookup_here("<init>"):
# Declare a shadow default constructor
wrapper_type = PyrexTypes.CFuncType(entry.type, [], nogil=1)
wrapper_cname = "%s__constructor__%s" % (Naming.func_prefix, name)
......
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