From: Stefan Behnel Date: Fri, 12 Nov 2010 22:54:10 +0000 (+0100) Subject: fix interaction between complex types and IntNode X-Git-Tag: 0.14.alpha0~158 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d591804e7041ce3d5ace61f8445c0147d94125aa;p=cython.git fix interaction between complex types and IntNode --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 0358604c..6069f1d3 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -847,9 +847,16 @@ class IntNode(ConstNode): node = IntNode(self.pos, value=self.value, constant_result=self.constant_result, type = dst_type, unsigned=self.unsigned, longness=self.longness) if dst_type.is_numeric and not dst_type.is_complex: + node = IntNode(self.pos, value=self.value, constant_result=self.constant_result, + type = dst_type, unsigned=self.unsigned, longness=self.longness) return node - if dst_type.is_pyobject: - node.type = PyrexTypes.py_object_type + elif dst_type.is_pyobject: + node = IntNode(self.pos, value=self.value, constant_result=self.constant_result, + type = PyrexTypes.py_object_type, unsigned=self.unsigned, longness=self.longness) + else: + # not setting the type here! + node = IntNode(self.pos, value=self.value, constant_result=self.constant_result, + unsigned=self.unsigned, longness=self.longness) # We still need to perform normal coerce_to processing on the # result, because we might be coercing to an extension type, # in which case a type test node will be needed.