diff options
author | Luca Bruno <lucabru@src.gnome.org> | 2014-05-17 21:42:09 +0200 |
---|---|---|
committer | Luca Bruno <lucabru@src.gnome.org> | 2014-05-17 21:42:09 +0200 |
commit | a3692434eaa399c9009f6497091ab1dd6900fd8a (patch) | |
tree | af3df24517376829ffbed53a2164ce049fbdf1d8 /vala | |
parent | 0ffe72386589ad6a7f52f95a68929277a31cf719 (diff) | |
download | vala-a3692434eaa399c9009f6497091ab1dd6900fd8a.tar.gz |
Fix writing vapis with (unowned type)[]
Diffstat (limited to 'vala')
-rw-r--r-- | vala/valaarraytype.vala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala index e1bf8d0e1..caab109cb 100644 --- a/vala/valaarraytype.vala +++ b/vala/valaarraytype.vala @@ -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; } } |