Opened 7 years ago

Closed 7 years ago

#230 closed defect (fixed)

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:

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.

Change History (4)

comment:1 Changed 7 years ago by scoder

  • Description modified (diff)

comment:2 Changed 7 years ago by scoder

  • Description modified (diff)

comment:4 Changed 7 years ago by robertwb

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