check whether delegate matches method, fixes bug 515617
authorJuerg Billeter <j@bitron.ch>
Sat, 23 Feb 2008 12:50:55 +0000 (12:50 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 23 Feb 2008 12:50:55 +0000 (12:50 +0000)
2008-02-23  Juerg Billeter  <j@bitron.ch>

* vala/valamethodtype.vala: check whether delegate matches method,
  fixes bug 515617

svn path=/trunk/; revision=1033

ChangeLog
vala/valamethodtype.vala

index a466bae..c9d3920 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-02-23  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valamethodtype.vala: check whether delegate matches method,
+         fixes bug 515617
+
+2008-02-23  Jürg Billeter  <j@bitron.ch>
+
        * gen-project/valaprojectgenerator.vala: fix Date.set_time_val call
 
 2008-02-22  Jürg Billeter  <j@bitron.ch>
index 2bd3b58..e04fb62 100644 (file)
@@ -47,4 +47,18 @@ public class Vala.MethodType : DataType {
        public override DataType! copy () {
                return new MethodType (method_symbol);
        }
+
+       public override bool compatible (DataType! target_type, bool enable_non_null = true) {
+               var dt = target_type as DelegateType;
+               if (dt == null) {
+                       // method types incompatible to anything but delegates
+                       return false;
+               }
+               
+               return dt.delegate_symbol.matches_method (method_symbol);
+       }
+
+       public override string! to_string () {
+               return method_symbol.get_full_name ();
+       }
 }