]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Check rank when checking array type compatibility
authorJürg Billeter <j@bitron.ch>
Sat, 20 Mar 2010 22:06:48 +0000 (23:06 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 20 Mar 2010 22:06:48 +0000 (23:06 +0100)
Fixes bug 577222.

vala/valaarraytype.vala

index 2ed20f227baaa63b6a6232d48d56f04c86ae3fa9..9561a610a90f080e29f2960b9c3ae68296845c74 100644 (file)
@@ -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;