]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not support assigning to `this'
authorLuca Bruno <lethalman88@gmail.com>
Wed, 2 Jun 2010 09:11:03 +0000 (11:11 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 20 Jun 2010 19:02:25 +0000 (21:02 +0200)
Fixes bug 620120.

vala/valaassignment.vala

index 5833e6be40c545745ada2f12e2cbce4a9bf0208b..575ff966fd8a1e6c29f8e292d355e2318407bd24 100644 (file)
@@ -145,7 +145,8 @@ public class Vala.Assignment : Expression {
                if (left is MemberAccess) {
                        var ma = (MemberAccess) left;
 
-                       if (!(ma.symbol_reference is Signal || ma.symbol_reference is DynamicProperty) && ma.value_type == null) {
+                       if ((!(ma.symbol_reference is Signal || ma.symbol_reference is DynamicProperty) && ma.value_type == null) ||
+                           (ma.inner == null && ma.member_name == "this" && analyzer.is_in_instance_method ())) {
                                error = true;
                                Report.error (source_reference, "unsupported lvalue in assignment");
                                return false;