]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix setting of generic-type properties for gobject style chain up
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 31 Oct 2019 09:39:44 +0000 (10:39 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 7 Nov 2019 11:11:48 +0000 (12:11 +0100)
Correctly refer to their canonical names.

See https://bugzilla.gnome.org/show_bug.cgi?id=654702

codegen/valaccodebasemodule.vala

index 54bf70bc51bd62a4ba866d4c804b1277b64c2838..f23c42b421607b1a3224f65e8a7a6be523851410 100644 (file)
@@ -4714,10 +4714,10 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                int type_param_index = 0;
                foreach (var type_arg in type_args) {
                        if (type_parameters != null) {
-                               var type_param_name = type_parameters.get (type_param_index).name.down ();
-                               arg_map.set (get_param_pos (0.1 * type_param_index + 0.01), new CCodeConstant ("\"%s_type\"".printf (type_param_name)));
-                               arg_map.set (get_param_pos (0.1 * type_param_index + 0.03), new CCodeConstant ("\"%s_dup_func\"".printf (type_param_name)));
-                               arg_map.set (get_param_pos (0.1 * type_param_index + 0.05), new CCodeConstant ("\"%s_destroy_func\"".printf (type_param_name)));
+                               var type_param_name = type_parameters.get (type_param_index).name.down ().replace ("_", "-");
+                               arg_map.set (get_param_pos (0.1 * type_param_index + 0.01), new CCodeConstant ("\"%s-type\"".printf (type_param_name)));
+                               arg_map.set (get_param_pos (0.1 * type_param_index + 0.03), new CCodeConstant ("\"%s-dup-func\"".printf (type_param_name)));
+                               arg_map.set (get_param_pos (0.1 * type_param_index + 0.05), new CCodeConstant ("\"%s-destroy-func\"".printf (type_param_name)));
                        }
 
                        arg_map.set (get_param_pos (0.1 * type_param_index + 0.02), get_type_id_expression (type_arg, is_chainup));