From: Luca Bruno Date: Sat, 28 Jun 2014 08:42:14 +0000 (+0200) Subject: codewriter: Do not write (unowned string)[] for constants X-Git-Tag: 0.25.1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c36eb4063ecb7ece8280de260c279f17139a504;p=thirdparty%2Fvala.git codewriter: Do not write (unowned string)[] for constants The element type of a constant array is forced to be unowned in the parser. Therefore we don't write (unowned string) to avoid breaking vapi parsing uselessly with older valac versions. Fixes bug 732080 --- diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala index caab109cb..8ba119853 100644 --- a/vala/valaarraytype.vala +++ b/vala/valaarraytype.vala @@ -166,7 +166,7 @@ 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 ()) { + if (element_type.is_weak () && !(element_type.parent_node is Constant)) { elem_str = "(unowned %s)".printf (elem_str); }