]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix base class method compatibility check with the ellipsis parameter
authorLuca Bruno <lucabru@src.gnome.org>
Mon, 10 Jan 2011 09:50:48 +0000 (10:50 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 15 Jan 2011 09:23:25 +0000 (10:23 +0100)
Fixes bug 633218.

vala/valamethod.vala

index bc301f5cc691dd322850efdec19e0fa32d7a46e4..65d062f5502907444cbd355ca7ec4e571799b3c2 100644 (file)
@@ -537,12 +537,19 @@ public class Vala.Method : Subroutine {
                                invalid_match = "too few parameters";
                                return false;
                        }
-                       
-                       actual_base_type = base_param.variable_type.get_actual_type (object_type, null, this);
-                       if (!actual_base_type.equals (method_params_it.get ().variable_type)) {
-                               invalid_match = "incompatible type of parameter %d".printf (param_index);
+
+                       var param = method_params_it.get ();
+                       if (base_param.ellipsis != param.ellipsis) {
+                               invalid_match = "ellipsis parameter mismatch";
                                return false;
                        }
+                       if (!base_param.ellipsis) {
+                               actual_base_type = base_param.variable_type.get_actual_type (object_type, null, this);
+                               if (!actual_base_type.equals (param.variable_type)) {
+                                       invalid_match = "incompatible type of parameter %d".printf (param_index);
+                                       return false;
+                               }
+                       }
                        param_index++;
                }