Commit 695f906c authored by Robert Bradshaw's avatar Robert Bradshaw

Fix e_cstruct test.

parent 8bb7d5a2
# mode: error # mode: error
cdef struct Spam: cdef struct Spam:
int i int i
char c char c
float *p[42] float[42] *p
obj # error - py object obj # error - py object
#cdef struct Spam: # error - redefined (not an error in Cython, should it be?) #cdef struct Spam: # error - redefined (not an error in Cython, should it be?)
# int j # int j
cdef struct Grail cdef struct Grail
cdef void eggs(Spam s): cdef void eggs(Spam s):
cdef int j cdef int j
cdef Grail *gp cdef Grail *gp
j = s.k # error - undef attribute j = s.k # error - undef attribute
j = s.p # type error j = s.p # type error
s.p = j # type error s.p = j # type error
j = j.i # no error - coercion to Python object j = j.i # no error - coercion to Python object
j.i = j # no error - coercion to Python object j.i = j # no error - coercion to Python object
j = gp.x # error - incomplete type j = gp.x # error - incomplete type
gp.x = j # error - incomplete type gp.x = j # error - incomplete type
_ERRORS = u""" _ERRORS = u"""
7:36: C struct/union member cannot be a Python object 7:39: C struct/union member cannot be a Python object
17:6: Object of type 'Spam' has no attribute 'k' 17:9: Object of type 'Spam' has no attribute 'k'
18:6: Cannot assign type 'float *[42]' to 'int' 18:9: Cannot assign type 'float (*)[42]' to 'int'
19:21: Cannot assign type 'int' to 'float *[42]' 19:24: Cannot assign type 'int' to 'float (*)[42]'
22:7: Cannot select attribute of incomplete type 'Grail' 22:10: Cannot select attribute of incomplete type 'Grail'
23:3: Cannot select attribute of incomplete type 'Grail' 23:6: Cannot select attribute of incomplete type 'Grail'
""" """
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment