summaryrefslogtreecommitdiff
path: root/vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-03-22 14:39:32 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2017-03-22 14:59:53 +0100
commit46a1225768849c3d255c247e93b3e705f991baf7 (patch)
tree751fdb12f9989546508e9b5c4c85d3ed49d8fc83 /vala
parentad0530ec6d02290d1dfe8715cb2d000edc69711d (diff)
downloadvala-46a1225768849c3d255c247e93b3e705f991baf7.tar.gz
vala: Slightly improve lamdba-expression error on target-type mismatch
Diffstat (limited to 'vala')
-rw-r--r--vala/valalambdaexpression.vala6
1 files changed, 5 insertions, 1 deletions
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index 1d6f95713..d194eca6f 100644
--- a/vala/valalambdaexpression.vala
+++ b/vala/valalambdaexpression.vala
@@ -128,7 +128,11 @@ public class Vala.LambdaExpression : Expression {
if (!(target_type is DelegateType)) {
error = true;
- Report.error (source_reference, "lambda expression not allowed in this context");
+ if (target_type != null) {
+ Report.error (source_reference, "Cannot convert lambda expression to `%s'".printf (target_type.to_string ()));
+ } else {
+ Report.error (source_reference, "lambda expression not allowed in this context");
+ }
return false;
}