fix upcast to renamed class

This commit is contained in:
David Rose 2002-03-28 01:19:06 +00:00
parent beae245e5a
commit 8f72ae5079
2 changed files with 12 additions and 2 deletions

View File

@ -490,8 +490,13 @@ class FFIInterrogateDatabase:
typeDescs = self.constructFunctionTypeDescriptors(funcIndex)
for typeDesc in typeDescs:
funcSpec = FFISpecs.MethodSpecification()
funcSpec.name = FFIRename.methodNameFromCppName(
interrogate_function_name(funcIndex))
# We synthesize the upcast function name instead
# of using the name supplied by interrogate, to
# allow for possible renaming of types on this
# side.
funcSpec.name = 'upcastTo' + typeDesc.returnType.typeDescriptor.foreignTypeName
#funcSpec.name = FFIRename.methodNameFromCppName(
# interrogate_function_name(funcIndex))
funcSpec.typeDescriptor = typeDesc
funcSpec.index = funcIndex
funcSpecs.append(funcSpec)

View File

@ -473,9 +473,14 @@ class MethodSpecification(FunctionSpecification):
childClass = parentList[i-1]
if childClass.hasMethodNamed(methodName):
indent(file, nesting+2, 'upcastSelf = upcastSelf.' + methodName + '()\n')
else:
indent(file, nesting+2, '# upcastSelf = upcastSelf.' + methodName + '()\n')
else:
if methodClass.hasMethodNamed(methodName):
indent(file, nesting+2, 'upcastSelf = upcastSelf.' + methodName + '()\n')
else:
indent(file, nesting+2, '# upcastSelf = upcastSelf.' + methodName + '()\n')
indent(file, nesting+2, 'returnValue = ' + self.typeDescriptor.moduleName
+ '.' + self.typeDescriptor.wrapperName + '(upcastSelf.this')
if (len(thislessArgTypes) > 0):