[vala/staging] girparser: Detect AsyncReadyCallback parameter in process_callable()



commit 3713e8e53ff15996ac50d3368a0f95a04e29405d
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Apr 17 23:13:51 2020 +0200

    girparser: Detect AsyncReadyCallback parameter in process_callable()

 vala/valagirparser.vala | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 338775dc5..4762dfb0b 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -3414,16 +3414,6 @@ public class Vala.GirParser : CodeVisitor {
                                }
 
                                var info = new ParameterInfo (param, array_length_idx, closure_idx, 
destroy_idx, scope == "async");
-
-                               if (s is Method && scope == "async") {
-                                       unowned UnresolvedType? 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);
                                pop_metadata ();
                        }
@@ -3934,6 +3924,15 @@ public class Vala.GirParser : CodeVisitor {
                                }
                        }
 
+                       if (s is Method && info.is_async) {
+                               unowned UnresolvedType? unresolved_type = type as UnresolvedType;
+                               if (unresolved_type != null && unresolved_type.unresolved_symbol.name == 
"AsyncReadyCallback") {
+                                       // GAsync-style method
+                                       ((Method) s).coroutine = true;
+                                       info.keep = false;
+                               }
+                       }
+
                        if (s is Delegate && !s.tree_can_fail && info.param.direction == 
ParameterDirection.OUT) {
                                unowned UnresolvedType? unresolved_type = type as UnresolvedType;
                                if (unresolved_type != null && unresolved_type.unresolved_symbol.to_string () 
== "GLib.Error") {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]