Cython has moved to github.

cython-devel

view tests/errors/e_badtypeuse.pyx @ 1277:d6b77994c455

Fix ticket #98, better error reporting on bad types.
author Robert Bradshaw <robertwb@math.washington.edu>
date Tue Oct 28 12:49:48 2008 -0700 (3 years ago)
parents 78e6f3140507
children 1dadfbd04642
line source
1 cdef struct Grail
3 cdef extern object xobj # Python object cannot be extern
4 cdef object aobj[42] # array element cannot be Python object
5 cdef object *pobj # pointer base type cannot be Python object
7 cdef int spam[] # incomplete variable type
8 cdef Grail g # incomplete variable type
9 cdef void nada # incomplete variable type
11 cdef int a_spam[17][] # incomplete element type
12 cdef Grail a_g[42] # incomplete element type
13 cdef void a_nada[88] # incomplete element type
15 cdef struct Eggs:
16 int spam[]
18 cdef f(Grail g, # incomplete argument type
19 void v, # incomplete argument type
20 int a[]):
21 pass
23 cdef NoSuchType* ptr
24 ptr = None # This should not produce another error
26 _ERRORS = u"""
27 3:19: Python object cannot be declared extern
28 4:16: Array element cannot be a Python object
29 5:12: Pointer base type cannot be a Python object
30 7:13: Variable type 'int []' is incomplete
31 8:11: Variable type 'Grail' is incomplete
32 9:10: Variable type 'void' is incomplete
33 11:15: Array element type 'int []' is incomplete
34 12:14: Array element type 'Grail' is incomplete
35 13:16: Array element type 'void' is incomplete
36 16:9: Variable type 'int []' is incomplete
37 #19:1: Function argument cannot be void
38 19:1: Use spam() rather than spam(void) to declare a function with no arguments.
39 18:7: Argument type 'Grail' is incomplete
40 19:1: Invalid use of 'void'
41 23:5: 'NoSuchType' is not a type identifier
42 """