[vala] Report error on invalid array creation expressions for stacked arrays



commit cb808bc94d7e0c2045af52595d5d358b102ce32e
Author: Jürg Billeter <j bitron ch>
Date:   Sat Mar 20 17:42:00 2010 +0100

    Report error on invalid array creation expressions for stacked arrays
    
    Fixes bug 540730.

 vala/valaparser.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index ed3a469..e42286d 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -831,6 +831,11 @@ public class Vala.Parser : CodeVisitor {
 		do {
 			if (!first) {
 				// array of arrays: new T[][42]
+
+				if (size_specified) {
+					throw new ParseError.SYNTAX (get_error ("size of inner arrays must not be specified in array creation expression"));
+				}
+
 				element_type = new ArrayType (element_type, size_specifier_list.size, element_type.source_reference);
 			} else {
 				first = false;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]