summaryrefslogtreecommitdiff
path: root/vala/valalambdaexpression.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2009-09-17 18:32:34 +0200
committerJürg Billeter <j@bitron.ch>2009-09-17 18:32:34 +0200
commit873e330917ecced15684491a511c38b45baf761f (patch)
tree9b66325fc29ea8cbd0394c9f0ac30cb62372360b /vala/valalambdaexpression.vala
parenta59d540b293051cef07a59bc9c92e79435c78eaa (diff)
downloadvala-873e330917ecced15684491a511c38b45baf761f.tar.gz
Report error when capturing uninitialized variables in closures
Diffstat (limited to 'vala/valalambdaexpression.vala')
-rw-r--r--vala/valalambdaexpression.vala7
1 files changed, 7 insertions, 0 deletions
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index b7bb1f3c5..16a51c1c3 100644
--- a/vala/valalambdaexpression.vala
+++ b/vala/valalambdaexpression.vala
@@ -226,4 +226,11 @@ public class Vala.LambdaExpression : Expression {
return !error;
}
+
+ public override void get_used_variables (Collection<LocalVariable> collection) {
+ // require captured variables to be initialized
+ if (method.closure) {
+ method.get_captured_variables (collection);
+ }
+ }
}