Commit 20f13f93 authored by Stefan Behnel's avatar Stefan Behnel

simple test case for safe double inference

parent 43173842
# cython: infer_types = all
cimport cython
from cython cimport typeof, infer_types
cdef class MyType:
......@@ -147,6 +148,23 @@ def loop():
pass
assert typeof(a) == "long"
@cython.test_fail_if_path_exists('//NameNode[@type.is_pyobject = True]')
@cython.test_assert_path_exists('//InPlaceAssignmentNode/NameNode',
'//NameNode[@type.is_pyobject]',
'//NameNode[@type.is_pyobject = False]')
@infer_types('safe')
def double_loop():
"""
>>> double_loop() == 1.0 * 10
True
"""
cdef int i
d = 1.0
for i in range(9):
d += 1.0
return d
cdef unicode retu():
return u"12345"
......
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