GNOME Bugzilla – Bug 677769
Unable to specify different name for async _finish function: so cannot subclass GLib.Volume because of mount() member
Last modified: 2016-09-18 13:46:41 UTC
Test case attached, which tries to implement a subclass of GLib.Volume. The C compilation fails with the following: /home/sam/build/src/vala-volume.vala.c: In function ‘test_volume_g_volume_interface_init’: /home/sam/build/src/vala-volume.vala.c:466:18: warning: assignment from incompatible pointer type [enabled by default] /home/sam/build/src/vala-volume.vala.c:467:7: error: ‘GVolumeIface’ has no member named ‘mount_fn_finish’ /home/sam/build/src/vala-volume.vala.c:469:15: warning: assignment from incompatible pointer type [enabled by default] /home/sam/build/src/vala-volume.vala.c:471:30: warning: assignment from incompatible pointer type [enabled by default] /home/sam/build/src/vala-volume.vala.c: In function ‘main’: /home/sam/build/src/vala-volume.vala.c:510:2: warning: passing argument 1 of ‘_vala_main’ from incompatible pointer type [enabled by default] /home/sam/build/src/vala-volume.vala.c:496:6: note: expected ‘const gchar *’ but argument is of type ‘char **’ error: cc exited with status 256 Compilation failed: 1 error(s), 7 warning(s) This is because the mount() async function in the C vtable has C name mount_fn(), but the compile function is called mount_finish(). Vala is assuming its name to be mount_fn_finish().
Created attachment 216042 [details] Test case for #667769
"compile function" should be "completion function" in the description above.
Created attachment 335802 [details] [review] gio-2.0: Force finish_vfunc_name of Volume.mount() to "mount_finish"
Attachment 335802 [details] pushed as c4336c0 - gio-2.0: Force finish_vfunc_name of Volume.mount() to "mount_finish"