From: Robert Bradshaw Date: Tue, 25 Sep 2007 21:47:12 +0000 (-0700) Subject: Use assignable_from for conditional node X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=71930383dbb0a30830c0ed5c2b1affa468786296;p=cython.git Use assignable_from for conditional node Fixes cdef int a, b cdef int *foo = &a if a else &b --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index aa147d11..06067b5f 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2805,6 +2805,10 @@ class CondExprNode(ExprNode): return type1 elif type1.is_pyobject or type2.is_pyobject: return py_object_type + elif type1.assignable_from(type2): + return type1 + elif type2.assignable_from(type1): + return type2 else: return None