report error when trying to declare private construct properties, patch by
authorJuerg Billeter <j@bitron.ch>
Fri, 21 Mar 2008 19:07:42 +0000 (19:07 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 21 Mar 2008 19:07:42 +0000 (19:07 +0000)
2008-03-21  Juerg Billeter  <j@bitron.ch>

* vala/valasemanticanalyzer.vala: report error when trying to
  declare private construct properties,
  patch by Daniel Silverstone, fixes bug 522685

svn path=/trunk/; revision=1146

ChangeLog
vala/valasemanticanalyzer.vala

index 31d3951..776430a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-03-21  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valasemanticanalyzer.vala: report error when trying to
+         declare private construct properties,
+         patch by Daniel Silverstone, fixes bug 522685
+
+2008-03-21  Jürg Billeter  <j@bitron.ch>
+
        * vala/valaenum.vala, vala/valaenumvalue.vala,
          vala/valainterfacewriter.vala, gobject/valaccodegenerator.vala,
          gobject/valaccodegeneratorinterface.vala,
index c868d51..257ea83 100644 (file)
@@ -629,6 +629,14 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                                }
                        }
                }
+
+               /* construct properties must be public */
+               if (prop.set_accessor != null && prop.set_accessor.construction) {
+                       if (prop.access != SymbolAccessibility.PUBLIC) {
+                               prop.error = true;
+                               Report.error (prop.source_reference, "%s: construct properties must be public".printf (prop.get_full_name ()));
+                       }
+               }
        }
 
        public override void visit_property_accessor (PropertyAccessor! acc) {