Test for struct pointer loop.
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 3 Mar 2011 03:42:20 +0000 (19:42 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 3 Mar 2011 03:42:20 +0000 (19:42 -0800)
tests/run/type_inference.pyx

index 845bb146bdf46a3a840ea2fad2077a8bf48d32fa..992bdcc227789ec88aa7a90ec7720d7e531acfbc 100644 (file)
@@ -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"