[vala] Fix writing vapis with (unowned type)[]



commit a3692434eaa399c9009f6497091ab1dd6900fd8a
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat May 17 21:42:09 2014 +0200

    Fix writing vapis with (unowned type)[]

 vala/valaarraytype.vala |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala
index e1bf8d0..caab109 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;
                }
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]