Commit aae6c5c9 authored by Robert Bradshaw's avatar Robert Bradshaw

More complete test and fix for template specialization issues.

Partial workaround for Github Issue #1852.
parent 97d39fea
...@@ -1924,7 +1924,7 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -1924,7 +1924,7 @@ class FuncDefNode(StatNode, BlockNode):
code.mark_pos(self.pos, trace=False) code.mark_pos(self.pos, trace=False)
code.putln("") code.putln("")
code.putln("/* function exit code */") code.putln("/* function exit codeX */")
# ----- Default return value # ----- Default return value
if not self.body.is_terminator: if not self.body.is_terminator:
......
...@@ -3666,8 +3666,11 @@ class CppClassType(CType): ...@@ -3666,8 +3666,11 @@ class CppClassType(CType):
if other_type.is_cpp_class: if other_type.is_cpp_class:
if self == other_type: if self == other_type:
return 1 return 1
elif (self.cname == other_type.cname # This messy logic is needed due to GH Issue #1852.
and (self.templates or other_type.templates)): elif (self.cname == other_type.cname and
(self.template_type and other_type.template_type
or self.templates
or other_type.templates)):
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):
......
...@@ -125,3 +125,16 @@ def test_GH1599(a, b): ...@@ -125,3 +125,16 @@ def test_GH1599(a, b):
(1, 2.0) (1, 2.0)
""" """
return public_return_pair(a, b) return public_return_pair(a, b)
# Related to GH Issue #1852.
cdef cppclass Callback[T]:#(UntypedCallback):
pass
cdef cppclass MyClass[O]:
void Invoke(Callback[O]*)
cdef cppclass MySubclass[T](MyClass[T]):
void Invoke(Callback[T]* callback):
pass
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