ensure that the error domains match when comparing two methods for
authorJuerg Billeter <j@bitron.ch>
Tue, 28 Aug 2007 19:05:29 +0000 (19:05 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Tue, 28 Aug 2007 19:05:29 +0000 (19:05 +0000)
2007-08-28  Juerg Billeter  <j@bitron.ch>

* vala/valamethod.vala: ensure that the error domains match when
  comparing two methods for equality, fixes bug 465123

svn path=/trunk/; revision=523

ChangeLog
vala/valamethod.vala

index 29abe06..2ae4ec2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-08-28  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valamethod.vala: ensure that the error domains match when
+         comparing two methods for equality, fixes bug 465123
+
+2007-08-28  Jürg Billeter  <j@bitron.ch>
+
        * ccode/valaccodeswitchstatement.vala,
          gobject/valacodegeneratorclass.vala: generate warning about invalid
          property ids, fixes bug 463668
index 66d9c33..216a37e 100644 (file)
@@ -355,7 +355,19 @@ public class Vala.Method : Member, Invokable {
                if (method_params_it.next ()) {
                        return false;
                }
-               
+
+               Iterator<TypeReference> method_error_domains_it = m2.get_error_domains ().iterator ();
+               foreach (TypeReference error_domain in error_domains) {
+                       /* method may not have less error domains */
+                       if (!method_error_domains_it.next ()) {
+                               return false;
+                       }
+
+                       if (!method_error_domains_it.get ().equals (error_domain)) {
+                               return false;
+                       }
+               }
+
                return true;
        }