or (self.cascade and self.cascade.has_int_operands())
def coerce_chars_to_ints(self, env):
- if self.operand1.type.is_string:
+ # coerce literal single-char strings to c chars
+ if self.operand1.type.is_string and isinstance(self.operand1, StringNode):
self.operand1 = self.operand1.coerce_to(PyrexTypes.c_uchar_type, env)
- if self.operand2.type.is_string:
+ if self.operand2.type.is_string and isinstance(self.operand2, StringNode):
self.operand2 = self.operand2.coerce_to(PyrexTypes.c_uchar_type, env)
if self.cascade:
self.cascade.coerce_chars_to_ints(env)
return self.operand2.type.is_int
def coerce_chars_to_ints(self, env):
- if self.operand2.type.is_string:
+ if self.operand2.type.is_string and isinstance(self.operand2, StringNode):
self.operand2 = self.operand2.coerce_to(PyrexTypes.c_uchar_type, env)
def coerce_cascaded_operands_to_temp(self, env):
cdef void f(self, int x):
pass
_ERRORS = u"""
-/Local/Projects/D/Pyrex/Source/Tests/Errors3/e_cmethbasematch.pyx:6:6: Signature does not match previous declaration
+/Local/Projects/D/Pyrex/Source/Tests/Errors3/e_cmethbasematch.pyx:6:6: Signature not compatible with previous declaration
/Local/Projects/D/Pyrex/Source/Tests/Errors3/e_cmethbasematch.pyx:2:6: Previous declaration is here
"""