After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 592769 - no_delegate_target Delegate Field as an argument produces uncompilable ccode
no_delegate_target Delegate Field as an argument produces uncompilable ccode
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.7.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 577620 (view as bug list)
Depends on:
Blocks: 592770
 
 
Reported: 2009-08-23 02:38 UTC by rainwoodman
Modified: 2010-03-26 17:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (4.86 KB, patch)
2009-10-16 16:56 UTC, rainwoodman
none Details | Review

Description rainwoodman 2009-08-23 02:38:01 UTC
If a delegate field is passed as an argument to a function call, and the delegate field doesn't have a target, the produced ccode doesn't compile.


Example Code:
--- log.vala ---
public static void main() {

	Log.set_default_handler(g_log_default_handler);
}

--- log.vapi ----
[CCode (delegate_target = false)]
public GLib.LogFunc g_log_default_handler;


valac log.vala log.vapi

/home/rainwoodman/Projects/vala/log.vala.c: In function ‘_main’:
/home/rainwoodman/Projects/vala/log.vala.c:13: error: ‘g_log_default_handler_target’ undeclared (first use in this function)
/home/rainwoodman/Projects/vala/log.vala.c:13: error: (Each undeclared identifier is reported only once
/home/rainwoodman/Projects/vala/log.vala.c:13: error: for each function it appears in.)
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)


The attachement fixes this issue.
Comment 1 Michael 'Mickey' Lauer 2009-10-15 22:44:38 UTC
There is no attachement visible, could you please upload?
Comment 2 rainwoodman 2009-10-16 16:56:20 UTC
Created attachment 145624 [details] [review]
the patch

I believe the g_log_default_handler binding is a workaround for this issue.
Comment 3 Jürg Billeter 2010-03-24 07:53:03 UTC
commit 02ff2455fe5f21d06ca431b078a15de03eaf3144
Author: Jürg Billeter <j@bitron.ch>
Date:   Wed Mar 24 08:52:04 2010 +0100

    Fix passing delegate field without target as method argument
    
    Fixes bug 592769.
Comment 4 Jürg Billeter 2010-03-26 17:23:00 UTC
*** Bug 577620 has been marked as a duplicate of this bug. ***