]> 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>
Sun, 3 Mar 2024 15:58:17 +0000 (16:58 +0100)
vala/valagirparser.vala

index 055a1fbb542649bb6a97a90d7e7f91a39a566d5e..76bb6a2c7f33fbddfb3bbe1cd70850430028b574 100644 (file)
@@ -2715,8 +2715,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));