2008-06-15 Jürg Billeter <j@bitron.ch>
* gobject/valaccodecreationmethodbinding.vala:
Report error when trying to assign private properties in creation
methods, patch by Hans Vercammen, fixes bug 536353
svn path=/trunk/; revision=1584
+2008-06-15 Jürg Billeter <j@bitron.ch>
+
+ * gobject/valaccodecreationmethodbinding.vala:
+
+ Report error when trying to assign private properties in creation
+ methods, patch by Hans Vercammen, fixes bug 536353
+
2008-06-15 Jürg Billeter <j@bitron.ch>
* gobject/valaccodegeneratorsignal.vala:
Report.error (stmt.source_reference, "class creation methods only allow property assignment statements");
return;
}
- if (((ExpressionStatement) stmt).assigned_property ().set_accessor.construction) {
+
+ Property prop = ((ExpressionStatement) stmt).assigned_property ();
+ if (prop.access == SymbolAccessibility.PRIVATE) {
+ m.error = true;
+ Report.error (stmt.source_reference, "class creation methods only allow assignments to public and protected properties");
+ return;
+ }
+ if (prop.set_accessor.construction) {
n_params++;
}
}