[vala] Consider fixed length array variables as defined
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] Consider fixed length array variables as defined
- Date: Sun, 6 Sep 2009 15:28:30 +0000 (UTC)
commit 5d7ee152bce9eca6c3e90a872923b15d352f9f7e
Author: Jürg Billeter <j bitron ch>
Date: Sun Sep 6 07:55:13 2009 +0200
Consider fixed length array variables as defined
vala/valadeclarationstatement.vala | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/vala/valadeclarationstatement.vala b/vala/valadeclarationstatement.vala
index 3f6c90e..428d88e 100644
--- a/vala/valadeclarationstatement.vala
+++ b/vala/valadeclarationstatement.vala
@@ -1,6 +1,6 @@
/* valadeclarationstatement.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
@@ -88,9 +88,14 @@ public class Vala.DeclarationStatement : CodeNode, Statement {
public override void get_defined_variables (Collection<LocalVariable> collection) {
var local = declaration as LocalVariable;
- if (local != null && local.initializer != null) {
- local.initializer.get_defined_variables (collection);
- collection.add (local);
+ if (local != null) {
+ var array_type = local.variable_type as ArrayType;
+ if (local.initializer != null) {
+ local.initializer.get_defined_variables (collection);
+ collection.add (local);
+ } else if (array_type != null && array_type.fixed_length) {
+ collection.add (local);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]