]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Fix detection of asynchronous methods
authorJürg Billeter <j@bitron.ch>
Wed, 15 Sep 2010 18:39:38 +0000 (20:39 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 15 Sep 2010 21:03:44 +0000 (23:03 +0200)
vala/valagirparser.vala

index f1730deeed4f0c6f92eb3c0b4e328e53fbcb9216..11405599a54da7db0808c648990bbbd70846e098 100644 (file)
@@ -1165,8 +1165,12 @@ public class Vala.GirParser : CodeVisitor {
                                var info = new MethodInfo(param, array_length_idx, closure_idx, destroy_idx);
 
                                if (s is Method && scope == "async") {
-                                       ((Method) s).coroutine = true;
-                                       info.keep = false;
+                                       var unresolved_type = param.variable_type as UnresolvedType;
+                                       if (unresolved_type != null && unresolved_type.unresolved_symbol.name == "AsyncReadyCallback") {
+                                               // GAsync-style method
+                                               ((Method) s).coroutine = true;
+                                               info.keep = false;
+                                       }
                                }
 
                                parameters.add (info);