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

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

codegen/valaccodebasemodule.vala

index 873f1ad3409e9b909d05a86d2e5db1706b196d99..f3c044a44f063ba843cc0ab10e758a0821d2a4f2 100644 (file)
@@ -4607,10 +4607,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));