From: Jürg Billeter Date: Sun, 15 Jun 2008 19:50:00 +0000 (+0000) Subject: Report error when trying to assign private properties in creation methods, X-Git-Tag: VALA_0_3_4~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=853284fae19da31a35ebcf2b8a6bdee7d1c21730;p=thirdparty%2Fvala.git Report error when trying to assign private properties in creation methods, 2008-06-15 Jürg Billeter * 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 --- diff --git a/ChangeLog b/ChangeLog index c34376ef4..d7ef7af69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-15 Jürg Billeter + + * 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 * gobject/valaccodegeneratorsignal.vala: diff --git a/gobject/valaccodecreationmethodbinding.vala b/gobject/valaccodecreationmethodbinding.vala index a76ac5324..411dea580 100644 --- a/gobject/valaccodecreationmethodbinding.vala +++ b/gobject/valaccodecreationmethodbinding.vala @@ -46,7 +46,14 @@ public class Vala.CCodeCreationMethodBinding : CCodeMethodBinding { 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++; } }