diff options
author | Jürg Billeter <j@bitron.ch> | 2008-12-17 23:07:18 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-12-17 23:07:18 +0000 |
commit | 3b29907bc25cd97da5e6814a575391f45c674d33 (patch) | |
tree | 28d331bc348bbe2b27f7c5b6f335790b75a73deb /vala/valaassignment.vala | |
parent | b290b3265126f73d32c457fbf7642afc7db902d5 (diff) | |
download | vala-3b29907bc25cd97da5e6814a575391f45c674d33.tar.gz |
Report error when trying to connect signal to instance method from static
2008-12-18 Jürg Billeter <j@bitron.ch>
* vala/valaassignment.vala:
Report error when trying to connect signal to instance method
from static context, fixes bug 502669
svn path=/trunk/; revision=2206
Diffstat (limited to 'vala/valaassignment.vala')
-rw-r--r-- | vala/valaassignment.vala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vala/valaassignment.vala b/vala/valaassignment.vala index cd870d19c..d24a7a39e 100644 --- a/vala/valaassignment.vala +++ b/vala/valaassignment.vala @@ -221,6 +221,7 @@ public class Vala.Assignment : Expression { } var dynamic_sig = sig as DynamicSignal; + var right_ma = right as MemberAccess; if (dynamic_sig != null) { bool first = true; foreach (FormalParameter param in dynamic_sig.handler.value_type.get_parameters ()) { @@ -238,6 +239,10 @@ public class Vala.Assignment : Expression { error = true; Report.error (right.source_reference, "method `%s' is incompatible with signal `%s', expected `%s'".printf (right.value_type.to_string (), right.target_type.to_string (), delegate_type.delegate_symbol.get_prototype_string (m.name))); return false; + } else if (right_ma != null && right_ma.prototype_access) { + error = true; + Report.error (right.source_reference, "Access to instance member `%s' denied".printf (m.get_full_name ())); + return false; } } else if (left is MemberAccess) { var ma = (MemberAccess) left; |