[vala] codewriter: Emit 'unowned' keyword for local variables



commit fcf4746ff1398b0a47ac304f80fb528839e1865a
Author: Simon <simon werbeck gmail com>
Date:   Fri Mar 14 10:28:43 2014 +0100

    codewriter: Emit 'unowned' keyword for local variables
    
    Fixes bug 726312

 vala/valacodewriter.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 62a9c5c..7f64fa2 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -847,6 +847,9 @@ public class Vala.CodeWriter : CodeVisitor {
        }
 
        public override void visit_local_variable (LocalVariable local) {
+               if (local.variable_type.is_weak ()) {
+                       write_string ("unowned ");
+               }
                write_type (local.variable_type);
                write_string (" ");
                write_identifier (local.name);


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