[vala] More error domain declaration fixes



commit bb41c3e355eeb9ca53eaf1777e67f97cd98ccc9f
Author: Jürg Billeter <j bitron ch>
Date:   Fri Apr 3 23:09:50 2009 +0200

    More error domain declaration fixes
    
    Fixes bug 577738.
---
 gobject/valaccodebasemodule.vala   |    5 +++++
 gobject/valaccodemethodmodule.vala |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/gobject/valaccodebasemodule.vala b/gobject/valaccodebasemodule.vala
index c5d2df6..847ac91 100644
--- a/gobject/valaccodebasemodule.vala
+++ b/gobject/valaccodebasemodule.vala
@@ -1117,6 +1117,11 @@ internal class Vala.CCodeBaseModule : CCodeModule {
 		} else if (type is ArrayType) {
 			var array_type = (ArrayType) type;
 			generate_type_declaration (array_type.element_type, decl_space);
+		} else if (type is ErrorType) {
+			var error_type = (ErrorType) type;
+			if (error_type.error_domain != null) {
+				generate_error_domain_declaration (error_type.error_domain, decl_space);
+			}
 		}
 
 		foreach (DataType type_arg in type.get_type_arguments ()) {
diff --git a/gobject/valaccodemethodmodule.vala b/gobject/valaccodemethodmodule.vala
index 4efab19..a404a55 100644
--- a/gobject/valaccodemethodmodule.vala
+++ b/gobject/valaccodemethodmodule.vala
@@ -105,6 +105,10 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
 		}
 
 		if (m.get_error_types ().size > 0) {
+			foreach (DataType error_type in m.get_error_types ()) {
+				generate_type_declaration (error_type, decl_space);
+			}
+
 			var cparam = new CCodeFormalParameter ("error", "GError**");
 			cparam_map.set (get_param_pos (-1), cparam);
 			if (carg_map != null) {



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