]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support scope = "async" on parameters.
authorLuca Bruno <lucabru@src.gnome.org>
Mon, 19 Nov 2012 13:06:30 +0000 (14:06 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Mon, 19 Nov 2012 13:10:12 +0000 (14:10 +0100)
This flag is still useful on delegates such as ThreadFunc that are
always scope = "async" by default. The flag on the parameter will
override the flag has been set on the delegate.

vala/valaparameter.vala

index b089dde22ad000417d6a0e70f7ad8cdcdaad6460..c42d6f33a548e803d1564c017218b0ceabdb3b9b 100644 (file)
@@ -147,6 +147,11 @@ public class Vala.Parameter : Variable {
                                return false;
                        }
 
+                       if (has_attribute_argument ("CCode", "scope") && variable_type is DelegateType) {
+                               var delegate_type = (DelegateType) variable_type;
+                               delegate_type.is_called_once = get_attribute_string ("CCode", "scope") == "async";
+                       }
+
                        if (initializer != null) {
                                initializer.target_type = variable_type.copy ();
                                initializer.check (context);