The solution in this patch is somewhat hackish, but should be OK.
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
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())