diff options
author | Jürg Billeter <j@bitron.ch> | 2011-06-17 12:48:32 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2011-06-17 12:54:30 +0200 |
commit | e63a6456521bf4c6202339a68a1bfa09015da5a8 (patch) | |
tree | cd69daba244609818cd6fa15f7c31748cc90d790 /vala/valamethodcall.vala | |
parent | 0bef85f44d9f1d0c06b3779a7bfddc4f673312f5 (diff) | |
download | vala-e63a6456521bf4c6202339a68a1bfa09015da5a8.tar.gz |
Fix .begin and .end on async methods using generic types
Fixes bug 652763.
Diffstat (limited to 'vala/valamethodcall.vala')
-rw-r--r-- | vala/valamethodcall.vala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index 23329bdcb..1f6b6a8c9 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -184,6 +184,21 @@ public class Vala.MethodCall : Expression { target_object_type = sig.inner.value_type; } } + + // foo is relevant instance in foo.bar.begin (bar_ready) and foo.bar.end (result) + var m = ma.symbol_reference as Method; + if (m != null && m.coroutine) { + // begin or end call of async method + if (ma.member_name == "begin" || ma.member_name == "end") { + var method_access = ma.inner as MemberAccess; + if (method_access != null && method_access.inner != null) { + target_object_type = method_access.inner.value_type; + } else { + // static method + target_object_type = null; + } + } + } } if (ma.symbol_reference != null && ma.symbol_reference.get_attribute ("Assert") != null) { |