From: Dag Sverre Seljebotn Date: Mon, 2 Nov 2009 19:50:02 +0000 (+0100) Subject: Temporary fix for #441 X-Git-Tag: 0.12.alpha0~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ac24781ed4c8e3e947cbb62e2a1a945d895192ad;p=cython.git Temporary fix for #441 --- diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 4ca7f3d5..282c5198 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -913,6 +913,13 @@ class CComplexType(CNumericType): real_type_name = real_type_name.replace('long__double','long_double') return Naming.type_prefix + real_type_name + "_complex" + def assignable_from(self, src_type): + # Temporary hack/feature disabling, see #441 + if not src_type.is_complex and src_type.is_numeric and src_type.is_typedef: + return False + else: + return super(CComplexType, self).assignable_from(src_type) + def assignable_from_resolved_type(self, src_type): return (src_type.is_complex and self.real_type.assignable_from_resolved_type(src_type.real_type) or src_type.is_numeric and self.real_type.assignable_from_resolved_type(src_type) diff --git a/tests/run/complex_numbers_T305.pyx b/tests/run/complex_numbers_T305.pyx index e59e0a41..6ae5aaad 100644 --- a/tests/run/complex_numbers_T305.pyx +++ b/tests/run/complex_numbers_T305.pyx @@ -125,13 +125,13 @@ ctypedef double complex cdouble def test_conjugate_typedef(cdouble z): return z.conjugate() -ctypedef double mydouble -def test_coerce_typedef_multiply(mydouble x, double complex z): - """ - >>> test_coerce_typedef_multiply(3, 1j) - (3j) - """ - return x * z +#ctypedef double mydouble +#def test_coerce_typedef_multiply(mydouble x, double complex z): +# """ +# >>> test_coerce_typedef_multiply(3, 1j) +# (3j) +# """ +# return x * z cpdef double complex complex_retval(): """