Commit da819b90 authored by gsamain's avatar gsamain

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 73b43166
......@@ -651,6 +651,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