]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Check parameter directions in inherited methods
authorSimon Werbeck <simon.werbeck@gmail.com>
Fri, 29 Mar 2013 02:12:38 +0000 (03:12 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Fri, 29 Mar 2013 20:31:53 +0000 (21:31 +0100)
Fixes bug 695214.

vala/valamethod.vala

index 7af50e8e81a39c43610de9951537826f80c0e6ee..cf02d60695f43034a06d4fb850b92c86ba971d98 100644 (file)
@@ -327,6 +327,11 @@ public class Vala.Method : Subroutine {
                                return false;
                        }
                        if (!base_param.ellipsis) {
+                               if (base_param.direction != param.direction) {
+                                       invalid_match = "incompatible direction of parameter %d".printf (param_index);
+                                       return false;
+                               }
+
                                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);