genbindings: subclass override functions need to use goMethodName

This commit is contained in:
mappu 2025-02-01 14:35:54 +13:00
parent 4eb07a18ea
commit daf3e82896

View File

@ -1052,7 +1052,7 @@ import "C"
goCbType += gfs.emitParametersGo(m.Parameters) goCbType += gfs.emitParametersGo(m.Parameters)
goCbType += `) ` + m.ReturnType.renderReturnTypeGo(&gfs) goCbType += `) ` + m.ReturnType.renderReturnTypeGo(&gfs)
callbackName := cabiCallbackName(c, m) callbackName := cabiCallbackName(c, m)
ret.WriteString(`func (this *` + goClassName + `) On` + m.SafeMethodName() + `(slot ` + goCbType + `) { ret.WriteString(`func (this *` + goClassName + `) On` + m.goMethodName() + `(slot ` + goCbType + `) {
ok := C.` + cabiOverrideVirtualName(c, m) + `(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)) ) ok := C.` + cabiOverrideVirtualName(c, m) + `(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)) )
if !ok { if !ok {
panic("miqt: can only override virtual methods for directly constructed types") panic("miqt: can only override virtual methods for directly constructed types")