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.
svn path=/trunk/; revision=1662
+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.
+
2008-06-29 Jürg Billeter <j@bitron.ch>
* vapi/packages/gdk-pixbuf-2.0/:
}
}
+ 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;