From 191e79856f15994fdfb0d471b13c67d3a603ff62 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 11 Feb 2010 11:53:39 -0800 Subject: [PATCH] Fix subclass specialization. --- Cython/Compiler/PyrexTypes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index d2e16663..96f1ee0c 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -1850,7 +1850,10 @@ class CppClassType(CType): return self.specializations[key] template_values = [t.specialize(values) for t in self.templates] specialized = self.specializations[key] = \ - CppClassType(self.name, None, self.cname, self.base_classes, template_values, template_type=self) + CppClassType(self.name, None, self.cname, [], template_values, template_type=self) + # Need to do these *after* self.specializations[key] is set to + # avoid infinite recursion on circular references. + specialized.base_classes = [b.specialize(values) for b in self.base_classes] specialized.scope = self.scope.specialize(values) return specialized -- 2.26.2