From: Simon Werbeck Date: Fri, 29 Mar 2013 02:12:38 +0000 (+0100) Subject: Check parameter directions in inherited methods X-Git-Tag: 0.20.1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00673f24ce975196cf1c2b01c8ca1bef8c946658;p=thirdparty%2Fvala.git Check parameter directions in inherited methods Fixes bug 695214. --- diff --git a/vala/valamethod.vala b/vala/valamethod.vala index 7af50e8e8..cf02d6069 100644 --- a/vala/valamethod.vala +++ b/vala/valamethod.vala @@ -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);