]> 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 19:31:24 +0000 (21:31 +0200)
vala/valagirparser.vala

index edb4d2fa94dbba6ac3337408d7323fc9b986589c..53cb317dddd42aa8ac7246ed87c3596726533da5 100644 (file)
@@ -1166,8 +1166,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);