Ticket #230 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

def-to-c(p)def method override in .pxd files fails for subclass methods

Reported by: scoder Owned by: robertwb
Priority: major Milestone: 0.11.1
Component: Parsing Keywords:
Cc:

Description (last modified by scoder) (diff)

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.

Change History

Changed 6 years ago by scoder

  • description modified (diff)

Changed 6 years ago by scoder

  • description modified (diff)

Changed 5 years ago by robertwb

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.