From: Jürg Billeter Date: Tue, 13 Jul 2010 12:42:54 +0000 (+0200) Subject: Fix naming issue with abstract async methods X-Git-Tag: 0.9.3~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=295973bd5df0a0b71819c61b49b2d72bb78a1cfe;p=thirdparty%2Fvala.git Fix naming issue with abstract async methods Fixes bug 623943. --- diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala index 180f417f5..aa786a5eb 100644 --- a/codegen/valaccodemethodmodule.vala +++ b/codegen/valaccodemethodmodule.vala @@ -977,7 +977,11 @@ public class Vala.CCodeMethodModule : CCodeStructModule { } public void generate_vfunc (Method m, DataType return_type, Map cparam_map, Map carg_map, string suffix = "", int direction = 3) { - var vfunc = new CCodeFunction (m.get_cname () + suffix); + string cname = m.get_cname (); + if (suffix == "_finish" && cname.has_suffix ("_async")) { + cname = cname.substring (0, cname.length - "_async".length); + } + var vfunc = new CCodeFunction (cname + suffix); if (function != null) { vfunc.line = function.line; } @@ -1003,7 +1007,11 @@ public class Vala.CCodeMethodModule : CCodeStructModule { } vcast.add_argument (new CCodeIdentifier ("self")); - var vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, m.vfunc_name + suffix)); + cname = m.vfunc_name; + if (suffix == "_finish" && cname.has_suffix ("_async")) { + cname = cname.substring (0, cname.length - "_async".length); + } + var vcall = new CCodeFunctionCall (new CCodeMemberAccess.pointer (vcast, cname + suffix)); carg_map.set (get_param_pos (m.cinstance_parameter_position), new CCodeIdentifier ("self")); generate_cparameters (m, source_declarations, cparam_map, vfunc, null, carg_map, vcall, direction);