]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Don't discard explictly given ctype of parameters
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 3 Mar 2024 15:53:35 +0000 (16:53 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 4 Mar 2024 09:22:11 +0000 (10:22 +0100)
vala/valagirparser.vala

index 703e3974ef4dfefe3aca22a2ab77cc9bef13d434..ed8f62ef08fa17d8b5a6b4313d392bff12492da9 100644 (file)
@@ -2669,8 +2669,12 @@ public class Vala.GirParser : CodeVisitor {
                        bool changed;
                        type = element_get_type (type, direction == "out" || direction == "inout", ref no_array_length, ref array_null_terminated, out changed);
                        if (!changed) {
-                               // discard ctype, duplicated information
-                               ctype = null;
+                               if (metadata.has_argument (ArgumentType.CTYPE)) {
+                                       ctype = metadata.get_string (ArgumentType.CTYPE);
+                               } else {
+                                       // discard ctype, duplicated information
+                                       ctype = null;
+                               }
                        }
 
                        param = new Parameter (name, type, get_src (begin));