Enable narrowing return type when subclassing
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 13 Feb 2008 02:08:20 +0000 (18:08 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 13 Feb 2008 02:08:20 +0000 (18:08 -0800)
Cython/Compiler/PyrexTypes.py

index 6ff1d2edfafe28b98016b8df0e68525bd9085dc2..8fe4d0790e6c4092c399d31aa9c0246f3a3dd9e8 100644 (file)
@@ -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