def-to-c(p)def method override in .pxd files fails for subclass methods
|Reported by:||scoder||Owned by:||robertwb|
Description (last modified by scoder)
The problem is in Symtab.CClassScope.declare_cfunction(). When declaring a method in a subclass, the Entry is looked up in the current scope and the base class method is found, which has a different type for the self argument (i.e. the base class type).
After that, AlignFunctionDefinitions is run to copy the declarations from the .pxd file to the .py file. It copies over the method declaration with the wrong signature entry. During the "analyse declarations" phase, .declare_cfunction() is called again. This time, it raises an exception because the type of the self argument does not match the surrounding type.