vala r930 - in trunk: . vala



Author: juergbi
Date: Wed Jan 30 16:38:04 2008
New Revision: 930
URL: http://svn.gnome.org/viewvc/vala?rev=930&view=rev

Log:
2008-01-30  Juerg Billeter  <j bitron ch>

	* vala/valasemanticanalyzer.vala: report error when using automatic
	  properties in interfaces, fixes bug 513157


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

Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala	(original)
+++ trunk/vala/valasemanticanalyzer.vala	Wed Jan 30 16:38:04 2008
@@ -637,7 +637,13 @@
 		if (!acc.source_reference.file.pkg) {
 			if (acc.body == null && !acc.prop.interface_only && !acc.prop.is_abstract) {
 				/* no accessor body specified, insert default body */
-			
+
+				if (acc.prop.parent_symbol is Interface) {
+					acc.error = true;
+					Report.error (acc.source_reference, "Automatic properties can't be used in interfaces");
+					return;
+				}
+
 				acc.body = new Block ();
 				if (acc.readable) {
 					acc.body.add_statement (new ReturnStatement (new MemberAccess.simple ("_%s".printf (acc.prop.name)), acc.source_reference));



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