[vala] Error when lambda parameter has incompatible direction with the delegate
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Error when lambda parameter has incompatible direction with the delegate
- Date: Thu, 4 Dec 2014 14:25:02 +0000 (UTC)
commit 56a939c3f16d0c9a90fb4f9e332838a234c08415
Author: Luca Bruno <lucabru src gnome org>
Date: Thu Dec 4 15:23:44 2014 +0100
Error when lambda parameter has incompatible direction with the delegate
Fixes bug 740894
vala/valalambdaexpression.vala | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index 61482f4..6918710 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]