From 6c36eb4063ecb7ece8280de260c279f17139a504 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Sat, 28 Jun 2014 10:42:14 +0200 Subject: [PATCH] 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 --- vala/valaarraytype.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.47.3