From 71930383dbb0a30830c0ed5c2b1affa468786296 Mon Sep 17 00:00:00 2001
From: Robert Bradshaw <robertwb@math.washington.edu>
Date: Tue, 25 Sep 2007 14:47:12 -0700
Subject: [PATCH] Use assignable_from for conditional node

Fixes

cdef int a, b
cdef int *foo = &a if a else &b
---
 Cython/Compiler/ExprNodes.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index aa147d11a..06067b5f7 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
         
-- 
2.30.9