From 4d0a5b91805639265619adee59d3ffab4ff3ca12 Mon Sep 17 00:00:00 2001 From: Juerg Billeter Date: Sat, 23 Feb 2008 12:50:55 +0000 Subject: [PATCH] check whether delegate matches method, fixes bug 515617 2008-02-23 Juerg Billeter * vala/valamethodtype.vala: check whether delegate matches method, fixes bug 515617 svn path=/trunk/; revision=1033 --- ChangeLog | 5 +++++ vala/valamethodtype.vala | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index a466bae..c9d3920 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-02-23 Jürg Billeter + * vala/valamethodtype.vala: check whether delegate matches method, + fixes bug 515617 + +2008-02-23 Jürg Billeter + * gen-project/valaprojectgenerator.vala: fix Date.set_time_val call 2008-02-22 Jürg Billeter diff --git a/vala/valamethodtype.vala b/vala/valamethodtype.vala index 2bd3b58..e04fb62 100644 --- a/vala/valamethodtype.vala +++ b/vala/valamethodtype.vala @@ -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 (); + } } -- 2.7.4