vala r929 - in trunk: . vala



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

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

	* vala/valasemanticanalyzer.vala: report error when trying to add
	  instance fields to interfaces, fixes bug 513152


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:29:25 2008
@@ -316,6 +316,12 @@
 	public override void visit_field (Field! f) {
 		f.accept_children (this);
 
+		if (f.instance && f.parent_symbol is Interface) {
+			f.error = true;
+			Report.error (f.source_reference, "Interfaces may not have instance fields");
+			return;
+		}
+
 		if (!f.is_internal_symbol ()) {
 			current_source_file.add_type_dependency (f.type_reference, SourceFileDependencyType.HEADER_SHALLOW);
 		} else {



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