Commit a48ee512 authored by William Stein's avatar William Stein

Get rid of this sort of error: "Cannot assign type 'gsl_complex' to 'gsl_complex'"

The solution in this patch is somewhat hackish, but should be OK.
parent e8d25746
......@@ -467,7 +467,10 @@ class ExprNode(Node):
elif src.type.is_pyobject:
src = CoerceFromPyTypeNode(dst_type, src, env)
else: # neither src nor dst are py types
if not dst_type.assignable_from(src_type):
# Added the string comparison, since for c types that
# is enough, but SageX gets confused when the types are
# in different files.
if not (str(src.type) == str(dst_type) or dst_type.assignable_from(src_type)):
error(self.pos, "Cannot assign type '%s' to '%s'" %
(src.type, dst_type))
return src
......
......@@ -90,7 +90,7 @@ class PyrexType:
return self.same_as_resolved_type(other_type.resolve(), **kwds)
def same_as_resolved_type(self, other_type):
return self is other_type or other_type is error_type
return self == other_type or other_type is error_type
def subtype_of(self, other_type):
return self.subtype_of_resolved_type(other_type.resolve())
......
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