Commit af702c96 authored by Lisandro Dalcin's avatar Lisandro Dalcin

additional test for type casts (ticket #417)

--HG--
extra : rebase_source : 3512ea980463bae13f30b0d8bd395cabe253e65c
parent cab342a2
...@@ -53,3 +53,29 @@ def foo3(arg): ...@@ -53,3 +53,29 @@ def foo3(arg):
TypeError: Cannot convert typetest_T417.Bar to typetest_T417.Foo TypeError: Cannot convert typetest_T417.Bar to typetest_T417.Foo
""" """
cdef val = <Foo?>arg cdef val = <Foo?>arg
cdef int count = 0
cdef object getFoo():
global count
count += 1
return Foo()
def test_getFoo():
"""
>>> test_getFoo()
1
"""
cdef int old_count = count
cdef Foo x = getFoo()
return count - old_count
def test_getFooCast():
"""
>>> test_getFooCast()
1
"""
cdef int old_count = count
cdef Foo x = <Foo?>getFoo()
return count - old_count
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