Commit 9cab8051 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Fix compile errors when using postconditions

2009-01-10  Jürg Billeter  <j@bitron.ch>

	* vala/valaclass.vala:
	* vala/valalocalvariable.vala:
	* vala/valamethod.vala:

	Fix compile errors when using postconditions

svn path=/trunk/; revision=2319
parent 490f501b
2009-01-10 Jürg Billeter <j@bitron.ch>
* vala/valaclass.vala:
* vala/valalocalvariable.vala:
* vala/valamethod.vala:
Fix compile errors when using postconditions
2009-01-10 Jürg Billeter <j@bitron.ch>
* gobject/valadbusclientmodule.vala:
......
/* valaclass.vala
*
* Copyright (C) 2006-2008 Jürg Billeter
* Copyright (C) 2006-2009 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -310,7 +310,6 @@ public class Vala.Class : ObjectTypeSymbol {
m.scope.remove (m.result_var.name);
}
m.result_var = new LocalVariable (m.return_type.copy (), "result");
m.scope.add (m.result_var.name, m.result_var);
}
if (m is CreationMethod) {
if (m.name == null) {
......
......@@ -192,8 +192,12 @@ public class Vala.LocalVariable : Symbol {
analyzer.current_symbol.scope.add (name, this);
var block = (Block) analyzer.current_symbol;
block.add_local_variable (this);
// current_symbol is a Method if this is the `result'
// variable used for postconditions
var block = analyzer.current_symbol as Block;
if (block != null) {
block.add_local_variable (this);
}
active = true;
......
......@@ -280,7 +280,7 @@ public class Vala.Method : Member {
}
if (result_var != null) {
result_var.variable_type.accept (visitor);
result_var.accept (visitor);
}
foreach (Expression precondition in preconditions) {
......@@ -703,7 +703,7 @@ public class Vala.Method : Member {
}
if (result_var != null) {
result_var.variable_type.check (analyzer);
result_var.check (analyzer);
}
foreach (Expression precondition in preconditions) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment