Commit c192ad41 authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Allow <MyStruct*>obj as well; as there is no canonical PyObject

parent 140313e2
...@@ -3939,7 +3939,8 @@ class TypecastNode(NewTempExprNode): ...@@ -3939,7 +3939,8 @@ class TypecastNode(NewTempExprNode):
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)
elif self.type.is_ptr: elif self.type.is_ptr:
if not self.type.base_type.is_void: base_type = self.type.base_type
if not base_type.is_void and not base_type.is_struct:
error(self.pos, "Python objects can only be cast to void*") error(self.pos, "Python objects can only be cast to void*")
else: else:
warning(self.pos, "No conversion from %s to %s, python object pointer used." % (self.type, self.operand.type)) warning(self.pos, "No conversion from %s to %s, python object pointer used." % (self.type, self.operand.type))
......
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