From: Robert Bradshaw Date: Thu, 3 Mar 2011 03:42:20 +0000 (-0800) Subject: Test for struct pointer loop. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7e01eaacc53fa9b6301d80315f3533ec7d34011b;p=cython.git Test for struct pointer loop. --- diff --git a/tests/run/type_inference.pyx b/tests/run/type_inference.pyx index 845bb146..992bdcc2 100644 --- a/tests/run/type_inference.pyx +++ b/tests/run/type_inference.pyx @@ -333,6 +333,20 @@ def loop_over_int_array(): pass return typeof(i) +cdef struct MyStruct: + int a + +def loop_over_struct_ptr(): + """ + >>> print( loop_over_struct_ptr() ) + MyStruct + """ + cdef MyStruct a_list[10] + cdef MyStruct *a_ptr = a_list + for i in a_list[:10]: + pass + return typeof(i) + cdef unicode retu(): return u"12345"