[vala] Fix postconditions in namespace methods



commit 57cd5f2e6be8d79c5cc6c7096c4a6194bdaa8bc1
Author: Jürg Billeter <j bitron ch>
Date:   Mon Sep 14 17:41:50 2009 +0200

    Fix postconditions in namespace methods
    
    Fixes bug 595134.

 vala/valanamespace.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/vala/valanamespace.vala b/vala/valanamespace.vala
index 7a31c8f..b7e16aa 100644
--- a/vala/valanamespace.vala
+++ b/vala/valanamespace.vala
@@ -378,6 +378,10 @@ public class Vala.Namespace : Symbol {
 			m.error = true;
 			return;
 		}
+		if (!(m.return_type is VoidType) && m.get_postconditions ().size > 0) {
+			m.result_var = new LocalVariable (m.return_type.copy (), "result", null, source_reference);
+			m.result_var.is_result = true;
+		}
 
 		methods.add (m);
 		scope.add (m.name, m);



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