self.analyse_types(env)
self.coerce_to(type, env)
return True
+ elif type and type.is_cpp_class:
+ for arg in self.args:
+ arg.analyse_types(env)
+ constructor = type.scope.lookup("<init>")
+ self.function = RawCNameExprNode(self.function.pos, constructor.type)
+ self.function.entry = constructor
+ self.function.set_cname(type.declaration_code(""))
+ self.analyse_c_function_call(env)
+ return True
def nogil_check(self, env):
func_type = self.function_type()
def assignable_from_resolved_type(self, other_type):
# TODO: handle operator=(...) here?
+ if other_type is error_type:
+ return True
return other_type.is_cpp_class and other_type.is_subclass(self)
def attributes_known(self):
api = 0, in_pxd = 0, modifiers = ()):
if name == self.name.split('::')[-1] and cname is None:
name = '<init>'
+ type.return_type = self.lookup(self.name).type
prev_entry = self.lookup_here(name)
entry = self.declare_var(name, type, pos, cname, visibility)
if prev_entry:
(2, 2.25, True)
"""
try:
- pair = new Pair[int, double](i, x)
- wrap = new Wrap[Pair[int, double]](deref(pair))
+ wrap = new Wrap[Pair[int, double]](Pair[int, double](i, x))
return wrap.get().first(), wrap.get().second(), deref(wrap) == deref(wrap)
finally:
- del pair, wrap
+ del wrap