]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Use dedicated error message for assignments to literals
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 7 Jan 2019 16:47:49 +0000 (17:47 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 7 Jan 2019 16:47:49 +0000 (17:47 +0100)
vala/valaassignment.vala

index ce3549aafcaaf314b87bb9bfea21cef9bbcf7a35..1c449ed74bb37afa6b8f8f0eef332a3160bdc3ba 100644 (file)
@@ -208,6 +208,10 @@ public class Vala.Assignment : Expression {
                        }
                } else if (left is PointerIndirection) {
                        right.target_type = left.value_type.copy ();
+               } else if (left is Literal) {
+                       error = true;
+                       Report.error (source_reference, "Literals are immutable");
+                       return false;
                } else {
                        error = true;
                        Report.error (source_reference, "unsupported lvalue in assignment");