GNOME Bugzilla – Bug 652706
protected virtual methods can't be annotated
Last modified: 2017-02-10 14:35:44 UTC
If I have a virtual method (declared in my class struct) but with no public function having the same name, then the virtual-method can't be annotated. I've added a test case in regress.h: http://cgit.collabora.com/git/user/xclaesse/gobject-introspection.git/commit/?h=virtual&id=d27efd9831c2d65e0f84a9f26976e102372de1e7 The .gir generated has introspectable="0" on the vmethod and the transfer full annotation is not applied. My use-case is to make a subclass in python and override that method.
Note that changing return type to int make it introspectable, so that's really just the (transfer full) annotation missing but I don't know where/how to put it...
reassigning to glib introspection as this is not specific to pygobject. It may be reassigned back once the gir gets fixed and if there are issues with pygobject itself.
Note that I also tried with typedef the method signature like a callback: http://cgit.collabora.com/git/user/xclaesse/gobject-introspection.git/commit/?h=testcase2&id=8d5be9fb7e15f7d9959bdcdd03c4114b732a7edf But then g-i think that's a field and not a virtual-method: <field name="dup_object"> <type name="TestObjDupObject" c:type="RegressTestObjDupObject"/> </field> Would that work still?
The links to cgit.collabora.com no longer work. Can you attach patches or examples here instead? This also might be related to bug 725501.
Indeed I delete the repository, I forgot I had code linked. Pushed it again: http://cgit.collabora.com/git/user/xclaesse/gobject-introspection.git/log/?h=virtual http://cgit.collabora.com/git/user/xclaesse/gobject-introspection.git/commit/?h=testcase2 I didn't work on that recently, so I wouldn't be surprised if it's already fixed...
*** Bug 730480 has been marked as a duplicate of this bug. ***
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Virtual functions can be annotated since commit 9b4185f8.