]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error for signal handlers throwing errors
authorJürg Billeter <j@bitron.ch>
Thu, 11 Nov 2010 13:52:57 +0000 (14:52 +0100)
committerJürg Billeter <j@bitron.ch>
Thu, 11 Nov 2010 13:52:57 +0000 (14:52 +0100)
vala/valadelegate.vala

index 00d9b39be36000031140228e206907e4fb48417b..b56744bc7bad899ea3fb81bf052b8db0c3d8db0e 100644 (file)
@@ -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;
        }