]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
report error when trying to set construct-only properties
authorJuerg Billeter <j@bitron.ch>
Sat, 19 Apr 2008 21:58:44 +0000 (21:58 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 19 Apr 2008 21:58:44 +0000 (21:58 +0000)
2008-04-19  Juerg Billeter  <j@bitron.ch>

* vala/valasemanticanalyzer.vala: report error when trying to set
  construct-only properties

svn path=/trunk/; revision=1278

ChangeLog
vala/valasemanticanalyzer.vala

index b0d4d63d7252b25439057ca5be7e21dca7d17922..39f6a25edcc0447a0bb05ae705d0233d1d683522 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-19  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valasemanticanalyzer.vala: report error when trying to set
+         construct-only properties
+
 2008-04-19  Jürg Billeter  <j@bitron.ch>
 
        * gobject/valaccodeassignmentbinding.vala: fix D-Bus signal
index 3cd85176cd6b6acc32f96f6637cef0ed60e53149..e0b00baae076d7887b312348a376b6c721b6969d 100644 (file)
@@ -3013,7 +3013,8 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        } else if (ma.symbol_reference is Property) {
                                var prop = (Property) ma.symbol_reference;
 
-                               if (prop.set_accessor == null) {
+                               if (prop.set_accessor == null
+                                   || (!prop.set_accessor.writable && !(find_current_method () is CreationMethod))) {
                                        ma.error = true;
                                        Report.error (ma.source_reference, "Property `%s' is read-only".printf (prop.get_full_name ()));
                                        return;