cython/cython — pull request #206 by nnemkin (2013-04-05 08:58:21+00:00)
Title: Fix C/C++ compilation error when if/else expression has extension class type.

This example fails to compile in C and C++ (I'm using MSVC):

cdef class ExtType:
pass

cdef int cond = ...
cdef ExtType a = ExtType(), b = ExtType()
cdef ExtType c = a if cond else b # generated code does not compile

Both assignment source (if/else expression) and target have the C type of ``struct __pyx_xxx_ExtType *``, but assignment goes through a ``PyObject *`` temporary, which is not type compatible and requires and explicit cast.

Note: I've retagged the test as "condexpr" for consistency with other if/else expression tests.