vala r1662 - in trunk: . vala



Author: jaredm
Date: Mon Jun 30 05:51:42 2008
New Revision: 1662
URL: http://svn.gnome.org/viewvc/vala?rev=1662&view=rev

Log:
2008-06-30  Jared Moore  <jaredm svn gnome org>

	* vala/valasemanticanalyzer.vala:

	Report error when an abstract method has a body, an extern method has
	a body, or a non-abstract non-extern method has no body, fixes bug 
	539692.


Modified:
   trunk/   (props changed)
   trunk/ChangeLog
   trunk/vala/valasemanticanalyzer.vala

Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala	(original)
+++ trunk/vala/valasemanticanalyzer.vala	Mon Jun 30 05:51:42 2008
@@ -455,6 +455,14 @@
 			}
 		}
 
+		if (m.is_abstract && m.body != null) {
+			Report.error (m.source_reference, "Abstract methods cannot have bodies");
+		} else if ((m.external || current_source_file.external_package) && m.body != null) {
+			Report.error (m.source_reference, "Extern methods cannot have bodies");
+		} else if (!m.is_abstract && !m.external && !current_source_file.external_package && m.body == null) {
+			Report.error (m.source_reference, "Non-abstract, non-extern methods must have bodies");
+		}
+
 		var old_symbol = current_symbol;
 		var old_return_type = current_return_type;
 		current_symbol = m;



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