]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix writing vapis with (unowned type)[]
authorLuca Bruno <lucabru@src.gnome.org>
Sat, 17 May 2014 19:42:09 +0000 (21:42 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Sat, 17 May 2014 19:42:09 +0000 (21:42 +0200)
vala/valaarraytype.vala

index e1bf8d0e1813cce141b2602232d9d8f99a564275..caab109cbf830ac3dd2123b4f5a0e453a0115301 100644 (file)
@@ -165,10 +165,15 @@ public class Vala.ArrayType : ReferenceType {
        }
 
        public override string to_qualified_string (Scope? scope) {
+               var elem_str = element_type.to_qualified_string (scope);
+               if (element_type.is_weak ()) {
+                       elem_str = "(unowned %s)".printf (elem_str);
+               }
+               
                if (!fixed_length) {
-                       return "%s[%s]%s".printf (element_type.to_qualified_string (scope), string.nfill (rank - 1, ','), nullable ? "?" : "");
+                       return "%s[%s]%s".printf (elem_str, string.nfill (rank - 1, ','), nullable ? "?" : "");
                } else {
-                       return element_type.to_qualified_string (scope);
+                       return elem_str;
                }
        }