From: Luca Bruno Date: Thu, 4 Dec 2014 14:23:44 +0000 (+0100) Subject: Error when lambda parameter has incompatible direction with the delegate X-Git-Tag: 0.27.1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56a939c3f16d0c9a90fb4f9e332838a234c08415;p=thirdparty%2Fvala.git Error when lambda parameter has incompatible direction with the delegate Fixes bug 740894 --- diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala index 61482f42a..691871056 100644 --- a/vala/valalambdaexpression.vala +++ b/vala/valalambdaexpression.vala @@ -183,6 +183,12 @@ public class Vala.LambdaExpression : Expression { } Parameter lambda_param = lambda_param_it.get (); + + if (lambda_param.direction != cb_param.direction) { + error = true; + Report.error (lambda_param.source_reference, "direction of parameter `%s' is incompatible with the target delegate".printf (lambda_param.name)); + } + lambda_param.variable_type = cb_param.variable_type.get_actual_type (target_type, null, this); method.add_parameter (lambda_param); }