Commit 9eecd7bf authored by Robert Bradshaw's avatar Robert Bradshaw

Python object pointer cast warnings

parent 77336058
...@@ -2610,9 +2610,13 @@ class TypecastNode(ExprNode): ...@@ -2610,9 +2610,13 @@ class TypecastNode(ExprNode):
self.is_temp = 1 self.is_temp = 1
if self.operand.type.to_py_function: if self.operand.type.to_py_function:
self.operand = self.operand.coerce_to_pyobject(env) self.operand = self.operand.coerce_to_pyobject(env)
else:
warning(self.pos, "No conversion from %s to %s, python object pointer used." % (self.operand.type, self.type))
elif from_py and not to_py: elif from_py and not to_py:
if self.type.from_py_function: if self.type.from_py_function:
self.operand = self.operand.coerce_to(self.type, env) self.operand = self.operand.coerce_to(self.type, env)
else:
warning(self.pos, "No conversion from %s to %s, python object pointer used." % (self.type, self.operand.type))
def check_const(self): def check_const(self):
self.operand.check_const() self.operand.check_const()
......
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