From ac24781ed4c8e3e947cbb62e2a1a945d895192ad Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Mon, 2 Nov 2009 20:50:02 +0100 Subject: [PATCH] Temporary fix for #441 --- Cython/Compiler/PyrexTypes.py | 7 +++++++ tests/run/complex_numbers_T305.pyx | 14 +++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) 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(): """ -- 2.26.2