Commit 7c8b08e0 authored by Robert Bradshaw's avatar Robert Bradshaw

Ignore optional type parameters when comparing cpp classes.

This posed an issue when the type parameter was a typedef.
parent 2a34dd23
...@@ -3675,6 +3675,8 @@ class CppClassType(CType): ...@@ -3675,6 +3675,8 @@ class CppClassType(CType):
if self.templates == other_type.templates: if self.templates == other_type.templates:
return 1 return 1
for t1, t2 in zip(self.templates, other_type.templates): for t1, t2 in zip(self.templates, other_type.templates):
if is_optional_template_param(t1) and is_optional_template_param(t2):
break
if not t1.same_as_resolved_type(t2): if not t1.same_as_resolved_type(t2):
return 0 return 0
return 1 return 1
......
...@@ -37,6 +37,16 @@ def test_vector(L): ...@@ -37,6 +37,16 @@ def test_vector(L):
print v.at(i) print v.at(i)
del v del v
ctypedef int my_int
def test_vector_typedef(L):
"""
>>> test_vector_typedef([1, 2, 3])
[1, 2, 3]
"""
cdef vector[my_int] v = L
cdef vector[int] vv = v
return vv
def test_vector_iterator(L): def test_vector_iterator(L):
""" """
>>> test_vector([11, 37, 389, 5077]) >>> test_vector([11, 37, 389, 5077])
......
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