[vala] Add GError parameter for overriding methods where necessary



commit 50007f6334297a929d58ecc57864a643e64ca3c2
Author: Jürg Billeter <j bitron ch>
Date:   Mon Jul 27 19:15:31 2009 +0200

    Add GError parameter for overriding methods where necessary
    
    Check the error types of the base method as well, fixes bug 548283.

 codegen/valaccodemethodmodule.vala |    2 +-
 vala/valamethod.vala               |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index 36ec078..eb73b0f 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -104,7 +104,7 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
 			}
 		}
 
-		if (m.get_error_types ().size > 0) {
+		if (m.get_error_types ().size > 0 || (m.base_method != null && m.base_method.get_error_types ().size > 0)) {
 			foreach (DataType error_type in m.get_error_types ()) {
 				generate_type_declaration (error_type, decl_space);
 			}
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 5acfc65..5fa7dd0 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -453,7 +453,7 @@ public class Vala.Method : Member {
 			return false;
 		}
 
-		/* this method may throw more but not less errors than the base method */
+		/* this method may throw less but not more errors than the base method */
 		foreach (DataType method_error_type in get_error_types ()) {
 			bool match = false;
 			foreach (DataType base_method_error_type in base_method.get_error_types ()) {



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