[vala] Check rank when checking array type compatibility



commit 168baaf662955ad1ca1040268c96bab06142f3d2
Author: Jürg Billeter <j bitron ch>
Date:   Sat Mar 20 23:06:48 2010 +0100

    Check rank when checking array type compatibility
    
    Fixes bug 577222.

 vala/valaarraytype.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala
index 2ed20f2..9561a61 100644
--- a/vala/valaarraytype.vala
+++ b/vala/valaarraytype.vala
@@ -1,6 +1,6 @@
 /* valaarraytype.vala
  *
- * Copyright (C) 2007-2009  Jürg Billeter
+ * Copyright (C) 2007-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
@@ -195,6 +195,10 @@ public class Vala.ArrayType : ReferenceType {
 			return false;
 		}
 
+		if (target_array_type.rank != rank) {
+			return false;
+		}
+
 		if (element_type.compatible (target_array_type.element_type)
 		    && target_array_type.element_type.compatible (element_type)) {
 			return true;



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