]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix .begin and .end on async methods using generic types
authorJürg Billeter <j@bitron.ch>
Fri, 17 Jun 2011 10:48:32 +0000 (12:48 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 17 Jun 2011 10:54:30 +0000 (12:54 +0200)
Fixes bug 652763.

vala/valamethodcall.vala

index 23329bdcbebd760c51bb9936f954128024581eef..1f6b6a8c99fea87fa13f478e9795aa34343faa8a 100644 (file)
@@ -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) {