Commit ac24781e authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Temporary fix for #441

parent c8b85056
......@@ -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)
......
......@@ -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():
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment