Commit 80135d83 authored by Robert Bradshaw's avatar Robert Bradshaw

Fix #258, extern builtin conflicts.

parent 16e50584
......@@ -917,7 +917,7 @@ class StringNode(PyConstNode):
is_identifier = None
def coerce_to(self, dst_type, env):
if dst_type is not py_object_type and dst_type is not str_type:
if dst_type is not py_object_type and not str_type.subtype_of(dst_type):
# if dst_type is Builtin.bytes_type:
# # special case: bytes = 'str literal'
# return BytesNode(self.pos, value=self.value)
......
......@@ -400,8 +400,11 @@ class BuiltinObjectType(PyObjectType):
return src_type.name == self.name or (
src_type.name == self.alternative_name and
src_type.name is not None)
elif src_type.is_extension_type:
return (src_type.module_name == '__builtin__' and
src_type.name == self.name)
else:
return not src_type.is_extension_type
return True
def typeobj_is_available(self):
return True
......
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