[vala/0.50] codegen: Make sure types of implicit delegate parameters are declared



commit 61c12ea94a8901f5166b37646745966c6450a1ec
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Feb 1 17:34:15 2021 +0100

    codegen: Make sure types of implicit delegate parameters are declared

 codegen/valaccodedelegatemodule.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/codegen/valaccodedelegatemodule.vala b/codegen/valaccodedelegatemodule.vala
index fa296623b..b2b553941 100644
--- a/codegen/valaccodedelegatemodule.vala
+++ b/codegen/valaccodedelegatemodule.vala
@@ -74,9 +74,11 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
                        // return delegate target if appropriate
                        var deleg_type = (DelegateType) d.return_type;
                        if (deleg_type.delegate_symbol.has_target) {
+                               generate_type_declaration (delegate_target_type, decl_space);
                                var cparam = new CCodeParameter (get_delegate_target_cname ("result"), 
get_ccode_name (delegate_target_type) + "*");
                                cparam_map.set (get_param_pos (get_ccode_delegate_target_pos (d)), cparam);
                                if (deleg_type.is_disposable ()) {
+                                       generate_type_declaration (delegate_target_destroy_type, decl_space);
                                        cparam = new CCodeParameter (get_delegate_target_destroy_notify_cname 
("result"), get_ccode_name (delegate_target_destroy_type) + "*");
                                        cparam_map.set (get_param_pos (get_ccode_delegate_target_pos (d) + 
0.01), cparam);
                                }
@@ -84,10 +86,12 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
                }
 
                if (d.has_target) {
+                       generate_type_declaration (delegate_target_type, decl_space);
                        var cparam = new CCodeParameter ("user_data", get_ccode_name (delegate_target_type));
                        cparam_map.set (get_param_pos (get_ccode_instance_pos (d)), cparam);
                }
                if (d.tree_can_fail) {
+                       generate_type_declaration (gerror_type, decl_space);
                        var cparam = new CCodeParameter ("error", "GError**");
                        cparam_map.set (get_param_pos (get_ccode_error_pos (d)), cparam);
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]