From d591804e7041ce3d5ace61f8445c0147d94125aa Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 12 Nov 2010 23:54:10 +0100 Subject: [PATCH] fix interaction between complex types and IntNode --- Cython/Compiler/ExprNodes.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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. -- 2.26.2