From: Robert Bradshaw Date: Wed, 13 Feb 2008 02:08:20 +0000 (-0800) Subject: Enable narrowing return type when subclassing X-Git-Tag: 0.9.6.14~29^2~36 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=77c33ad2a51a4a1a41ad6799699797e54aed2730;p=cython.git Enable narrowing return type when subclassing --- 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