[vala] Improve error message for static access to instance variables
- From: JÃrg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Improve error message for static access to instance variables
- Date: Thu, 2 Aug 2012 09:09:46 +0000 (UTC)
commit 808e45fd004ae6574ab1f3c8f30bb6a9889f6b93
Author: Geert Jordaens <geert jordaens telenet be>
Date: Thu Aug 2 11:08:01 2012 +0200
Improve error message for static access to instance variables
Fixes bug 642254.
vala/valabinaryexpression.vala | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index 07b3ee3..1457de3 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -243,6 +243,17 @@ public class Vala.BinaryExpression : Expression {
return false;
}
+ if (left.value_type is FieldPrototype) {
+ error = true;
+ Report.error (left.source_reference, "Access to instance member `%s' denied".printf (left.symbol_reference.get_full_name ()));
+ return false;
+ }
+ if (right.value_type is FieldPrototype) {
+ error = true;
+ Report.error (right.source_reference, "Access to instance member `%s' denied".printf (right.symbol_reference.get_full_name ()));
+ return false;
+ }
+
left.target_type = left.value_type.copy ();
left.target_type.value_owned = false;
right.target_type = right.value_type.copy ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]