From 7e01eaacc53fa9b6301d80315f3533ec7d34011b Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 2 Mar 2011 19:42:20 -0800 Subject: [PATCH] Test for struct pointer loop. --- tests/run/type_inference.pyx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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" -- 2.26.2