]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix postconditions in namespace methods
authorJürg Billeter <j@bitron.ch>
Mon, 14 Sep 2009 15:41:50 +0000 (17:41 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 14 Sep 2009 15:41:50 +0000 (17:41 +0200)
Fixes bug 595134.

vala/valanamespace.vala

index 7a31c8f896d8bfcaeaa23922c1a04c6ae500a4b5..b7e16aa3434b8c76d8fd98914bf47833339d033a 100644 (file)
@@ -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);