[vala] Report error when trying to capture ref or out parameter
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] Report error when trying to capture ref or out parameter
- Date: Wed, 30 Sep 2009 10:10:30 +0000 (UTC)
commit 49746c6c6328ec30a39cbe1ecb6b93d6f1d05397
Author: Jürg Billeter <j bitron ch>
Date: Wed Sep 30 12:10:05 2009 +0200
Report error when trying to capture ref or out parameter
vala/valamemberaccess.vala | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index af6ca6b..f12fdcc 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -457,6 +457,11 @@ public class Vala.MemberAccess : Expression {
param.captured = true;
m.body.captured = true;
+
+ if (param.direction != ParameterDirection.IN) {
+ error = true;
+ Report.error (source_reference, "Cannot capture reference or output parameter `%s'".printf (param.get_full_name ()));
+ }
}
} else if (member is Field) {
var f = (Field) member;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]