]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Apply explicitly given ctype metadata attributes on callables
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 18 Jan 2020 16:58:42 +0000 (17:58 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 20 Jan 2020 15:29:13 +0000 (16:29 +0100)
vala/valagirparser.vala

index f30d8b0d5967c9c2b0091f72ea642c6c7e2877b1..6719d8e0821d61c827cab7197dc42c2bb43c7c76 100644 (file)
@@ -3130,6 +3130,11 @@ public class Vala.GirParser : CodeVisitor {
                        symbol_type = element_name;
                }
 
+               string? ctype = null;
+               if (metadata.has_argument (ArgumentType.CTYPE)) {
+                       ctype = metadata.get_string (ArgumentType.CTYPE);
+               }
+
                string name = current.name;
                string throws_string = reader.get_attribute ("throws");
                string invoker = reader.get_attribute ("invoker");
@@ -3287,6 +3292,10 @@ public class Vala.GirParser : CodeVisitor {
                }
                current.return_array_length_idx = return_array_length_idx;
 
+               if (ctype != null) {
+                       s.set_attribute_string ("CCode", "type", ctype);
+               }
+
                current.symbol = s;
 
                if (metadata.has_argument (ArgumentType.FINISH_NAME)) {