vala r2319 - in trunk: . vala
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2319 - in trunk: . vala
- Date: Sat, 10 Jan 2009 11:56:30 +0000 (UTC)
Author: juergbi
Date: Sat Jan 10 11:56:30 2009
New Revision: 2319
URL: http://svn.gnome.org/viewvc/vala?rev=2319&view=rev
Log:
2009-01-10 JÃrg Billeter <j bitron ch>
* vala/valaclass.vala:
* vala/valalocalvariable.vala:
* vala/valamethod.vala:
Fix compile errors when using postconditions
Modified:
trunk/ChangeLog
trunk/vala/valaclass.vala
trunk/vala/valalocalvariable.vala
trunk/vala/valamethod.vala
Modified: trunk/vala/valaclass.vala
==============================================================================
--- trunk/vala/valaclass.vala (original)
+++ trunk/vala/valaclass.vala Sat Jan 10 11:56:30 2009
@@ -1,6 +1,6 @@
/* 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 @@
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) {
Modified: trunk/vala/valalocalvariable.vala
==============================================================================
--- trunk/vala/valalocalvariable.vala (original)
+++ trunk/vala/valalocalvariable.vala Sat Jan 10 11:56:30 2009
@@ -192,8 +192,12 @@
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;
Modified: trunk/vala/valamethod.vala
==============================================================================
--- trunk/vala/valamethod.vala (original)
+++ trunk/vala/valamethod.vala Sat Jan 10 11:56:30 2009
@@ -280,7 +280,7 @@
}
if (result_var != null) {
- result_var.variable_type.accept (visitor);
+ result_var.accept (visitor);
}
foreach (Expression precondition in preconditions) {
@@ -703,7 +703,7 @@
}
if (result_var != null) {
- result_var.variable_type.check (analyzer);
+ result_var.check (analyzer);
}
foreach (Expression precondition in preconditions) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]