From 295973bd5df0a0b71819c61b49b2d72bb78a1cfe Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Tue, 13 Jul 2010 14:42:54 +0200 Subject: [PATCH] Fix naming issue with abstract async methods Fixes bug 623943. --- codegen/valaccodemethodmodule.vala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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); -- 2.47.2