summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Bruno <lucabru@src.gnome.org>2014-12-04 15:23:44 +0100
committerLuca Bruno <lucabru@src.gnome.org>2014-12-04 15:24:31 +0100
commit56a939c3f16d0c9a90fb4f9e332838a234c08415 (patch)
treee1a75ede3c4735eee81e2be35689e170f13bc29e
parent02f7c82a4b810147142056722fb11cfec57a6829 (diff)
downloadvala-56a939c3f16d0c9a90fb4f9e332838a234c08415.tar.gz
Error when lambda parameter has incompatible direction with the delegate
Fixes bug 740894
-rw-r--r--vala/valalambdaexpression.vala6
1 files changed, 6 insertions, 0 deletions
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);
}