From: Stefan Behnel Date: Wed, 3 Dec 2008 22:03:51 +0000 (+0100) Subject: fix crashes on type casts X-Git-Tag: 0.11-beta~163 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=324666bce1d456d41eebd22517f44c16cc4d5d7e;p=cython.git fix crashes on type casts --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 38796add..36067a0b 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -3585,7 +3585,7 @@ def unop_node(pos, operator, operand): operand = operand) -class TypecastNode(ExprNode): +class TypecastNode(NewTempExprNode): # C type cast # # operand ExprNode diff --git a/tests/run/r_typecast.pyx b/tests/run/r_typecast.pyx new file mode 100644 index 00000000..e7884b65 --- /dev/null +++ b/tests/run/r_typecast.pyx @@ -0,0 +1,14 @@ +u""" +>>> call_method( ExtType() ).method() +1 +""" + +cdef class ExtType: + cdef c_method(self): + return self + + def method(self): + return 1 + +def call_method(ExtType et): + return et.c_method()