From 77c33ad2a51a4a1a41ad6799699797e54aed2730 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 12 Feb 2008 18:08:20 -0800 Subject: [PATCH] Enable narrowing return type when subclassing --- Cython/Compiler/PyrexTypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 6ff1d2ed..8fe4d079 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -676,7 +676,7 @@ class CFuncType(CType): return 0 if self.has_varargs != other_type.has_varargs: return 0 - if not self.return_type.same_as(other_type.return_type): + if not self.return_type.subtype_of_resolved_type(other_type.return_type): return 0 if not self.same_calling_convention_as(other_type): return 0 -- 2.26.2