]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix variable shadowing check with implicit result variable in properties
authorJürg Billeter <j@bitron.ch>
Sun, 21 Mar 2010 13:50:04 +0000 (14:50 +0100)
committerJürg Billeter <j@bitron.ch>
Sun, 21 Mar 2010 13:50:04 +0000 (14:50 +0100)
vala/valablock.vala

index 3a7eac7aadfa39dcd409607a9a23b1b3ad16474c..85a74cdb7232d13d66444f73e322ea43bbaaa6dd 100644 (file)
@@ -1,6 +1,6 @@
 /* valablock.vala
  *
- * Copyright (C) 2006-2009  Jürg Billeter
+ * Copyright (C) 2006-2010  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
@@ -88,7 +88,7 @@ public class Vala.Block : Symbol, Statement {
         */
        public void add_local_variable (LocalVariable local) {
                var parent_block = parent_symbol;
-               while (parent_block is Block || parent_block is Method) {
+               while (parent_block is Block || parent_block is Method || parent_block is PropertyAccessor) {
                        if (parent_block.scope.lookup (local.name) != null) {
                                Report.error (local.source_reference, "Local variable `%s' conflicts with another local variable declared in a parent scope".printf (local.name));
                                break;