mirror of
https://github.com/mappu/miqt.git
synced 2025-02-01 11:00:22 +00:00
genbindings: panic when trying to override methods on non-subclass
This commit is contained in:
parent
138883fb2d
commit
5271f8d4a1
@ -1028,6 +1028,9 @@ import "C"
|
||||
goCbType += `) ` + m.ReturnType.renderReturnTypeGo(&gfs)
|
||||
|
||||
ret.WriteString(`func (this *` + goClassName + `) On` + m.SafeMethodName() + `(slot ` + goCbType + `) {
|
||||
if ! this.isSubclass {
|
||||
panic("miqt: can only override virtual methods for directly constructed types")
|
||||
}
|
||||
C.` + goClassName + `_override_virtual_` + m.SafeMethodName() + `(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)) )
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user