[vala] dova: Fix use of interfaces in generics



commit f77453f40027f9e21c0ba6828cef9b16c26a9b63
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jul 21 09:05:15 2010 +0200

    dova: Fix use of interfaces in generics
    
    Fixes bug 613640.

 codegen/valadovaobjectmodule.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valadovaobjectmodule.vala b/codegen/valadovaobjectmodule.vala
index 1db3c62..e4e4761 100644
--- a/codegen/valadovaobjectmodule.vala
+++ b/codegen/valadovaobjectmodule.vala
@@ -961,6 +961,11 @@ internal class Vala.DovaObjectModule : DovaArrayModule {
 
 		type_init_block.add_statement (new CCodeExpressionStatement (new CCodeAssignment (new CCodeIdentifier ("%s_type".printf (iface.get_lower_case_cname ())), calloc_call)));
 
+		// call any_type_init to set value_copy and similar functions
+		var any_type_init_call = new CCodeFunctionCall (new CCodeIdentifier ("any_type_init"));
+		any_type_init_call.add_argument (new CCodeIdentifier ("%s_type".printf (iface.get_lower_case_cname ())));
+		type_init_block.add_statement (new CCodeExpressionStatement (any_type_init_call));
+
 		var type_init_call = new CCodeFunctionCall (new CCodeIdentifier ("%s_type_init".printf (iface.get_lower_case_cname ())));
 		type_init_call.add_argument (new CCodeIdentifier ("%s_type".printf (iface.get_lower_case_cname ())));
 		foreach (var type_param in iface.get_type_parameters ()) {



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