vala r1278 - in trunk: . vala



Author: juergbi
Date: Sat Apr 19 21:58:44 2008
New Revision: 1278
URL: http://svn.gnome.org/viewvc/vala?rev=1278&view=rev

Log:
2008-04-19  Juerg Billeter  <j bitron ch>

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


Modified:
   trunk/ChangeLog
   trunk/vala/valasemanticanalyzer.vala

Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala	(original)
+++ trunk/vala/valasemanticanalyzer.vala	Sat Apr 19 21:58:44 2008
@@ -3013,7 +3013,8 @@
 			} 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]