GNOME Bugzilla – Bug 633250
delegates that receives GError as parameter produce wrong C code
Last modified: 2010-11-03 14:28:22 UTC
Given this simple sample public delegate void DelegateType (GLib.Error? error); public void f2(GLib.Error? error) { print("Delegate calling"); if (error != null) print(error.message); } public void f1(DelegateType d) { d(null); } public static int main () { f1(f2); return 0; } This erroneous C code is generated: static void _f2_delegate_type (GError* _error_, gpointer self) { f2 (error); } It fails to compile because the symbol _error_ mismatch. According to git bisect, the commit which introduced this problem is * cc9c261 Add TargetValue class I could work on a patch until next week.
Created attachment 173734 [details] [review] Check for reserved identifiers in the delegate definition Please review the proposed patch and if it's ok, I'll push it.
commit 5884ac236b53df85fe6587b3f336cb688c65c28f Author: Víctor Manuel Jáquez Leal <vjaquez@igalia.com> Date: Wed Nov 3 01:22:56 2010 +0100 codegen: Fix reserved identifiers in delegate parameters Fixes bug 633250.