[vala] Report error for signal handlers throwing errors



commit 3f1b643a14b2068abb9eebc965cf17407bca3b1e
Author: Jürg Billeter <j bitron ch>
Date:   Thu Nov 11 14:52:57 2010 +0100

    Report error for signal handlers throwing errors

 vala/valadelegate.vala |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala
index 00d9b39..b56744b 100644
--- a/vala/valadelegate.vala
+++ b/vala/valadelegate.vala
@@ -208,7 +208,22 @@ public class Vala.Delegate : TypeSymbol {
 		if (method_params_it.next ()) {
 			return false;
 		}
-		
+
+		// method may throw less but not more errors than the delegate
+		foreach (DataType method_error_type in m.get_error_types ()) {
+			bool match = false;
+			foreach (DataType delegate_error_type in get_error_types ()) {
+				if (method_error_type.compatible (delegate_error_type)) {
+					match = true;
+					break;
+				}
+			}
+
+			if (!match) {
+				return false;
+			}
+		}
+
 		return true;
 	}
 



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