From: Jürg Billeter Date: Fri, 17 Jun 2011 10:48:32 +0000 (+0200) Subject: Fix .begin and .end on async methods using generic types X-Git-Tag: 0.13.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e63a6456521bf4c6202339a68a1bfa09015da5a8;p=thirdparty%2Fvala.git Fix .begin and .end on async methods using generic types Fixes bug 652763. --- 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) {