diff options
author | Juerg Billeter <j@bitron.ch> | 2008-02-23 12:50:55 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-02-23 12:50:55 +0000 |
commit | 4d0a5b91805639265619adee59d3ffab4ff3ca12 (patch) | |
tree | e95d34e25a00a574d54b9fa8f04032c2d00a5914 /vala/valamethodtype.vala | |
parent | 79d5e7916f070d4d81cc51ed31e661d7aa9b765f (diff) | |
download | vala-4d0a5b91805639265619adee59d3ffab4ff3ca12.tar.gz |
check whether delegate matches method, fixes bug 515617
2008-02-23 Juerg Billeter <j@bitron.ch>
* vala/valamethodtype.vala: check whether delegate matches method,
fixes bug 515617
svn path=/trunk/; revision=1033
Diffstat (limited to 'vala/valamethodtype.vala')
-rw-r--r-- | vala/valamethodtype.vala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vala/valamethodtype.vala b/vala/valamethodtype.vala index 2bd3b58d9..e04fb629b 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 (); + } } |