Ticket #60 (closed defect: fixed)
Failing case #2 for annotating code with errors
| Reported by: | hoytak@… | Owned by: | somebody |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.10 |
| Component: | Parsing | Keywords: | Code Annotation |
| Cc: |
Description
Hello,
I'm beginning to think that people generally run the annotator only on working code :-)
If I'm trying to annotate the following incorrect code, it causes the Annotator to raise an exception:
hoytak@ubuntu804desktop:~/workspace/clsynth-cython/clsynth$ cat testcase.pyx cdef class A:
cdef cinit(self):
self.X = not_defined
def init_A():
cdef A a[1]
a[0] = A()
hoytak@ubuntu804desktop:~/workspace/clsynth-cython/clsynth$ cython -a testcase.pyx e Error converting Pyrex file to C:
... cdef class A:
cdef cinit(self):
/home/hoytak/workspace/clsynth-cython/clsynth/testcase.pyx:2:9: Special methods must be declared with 'def', not 'cdef'
Error converting Pyrex file to C:
... cdef class A:
cdef cinit(self):
self.X = not_defined
def init_A():
cdef A a[1]
/home/hoytak/workspace/clsynth-cython/clsynth/testcase.pyx:6:12: Array element cannot be a Python object
Error converting Pyrex file to C:
... cdef class A:
cdef cinit(self):
self.X = not_defined
/home/hoytak/workspace/clsynth-cython/clsynth/testcase.pyx:3:28: undeclared name not builtin: not_defined Traceback (most recent call last):
File "/home/hoytak/sysroot/bin/cython", line 8, in <module>
main(command_line = 1)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 698, in main
result = compile(sources, options)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 675, in compile
return compile_multiple(source, options)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 645, in compile_multiple
result = run_pipeline(source, options)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 507, in run_pipeline
err, enddata = context.run_pipeline(pipeline, source)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 169, in run_pipeline
data = phase(data)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 114, in generate_pyx_code
module_node.process_implementation(options, result)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ModuleNode.py", line 67, in process_implementation
self.generate_c_code(env, options, result)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ModuleNode.py", line 259, in generate_c_code
self.body.generate_function_definitions(env, code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 277, in generate_function_definitions
stat.generate_function_definitions(env, code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 925, in generate_function_definitions
self.body.generate_execution_code(code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 283, in generate_execution_code
stat.generate_execution_code(code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 2274, in generate_execution_code
self.generate_assignment_code(code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 2325, in generate_assignment_code
self.lhs.generate_assignment_code(self.rhs, code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ExprNodes.py", line 1566, in generate_assignment_code
self.generate_setitem_code(rhs.py_result(), code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ExprNodes.py", line 1535, in generate_setitem_code
self.index_unsigned_parameter(),
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ExprNodes.py", line 1472, in index_unsigned_parameter
if self.original_index_type.signed:
AttributeError?: 'IndexNode?' object has no attribute 'original_index_type'
