]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Properties, Methods: Relax some checks
authorRyan Lortie <desrt@desrt.ca>
Tue, 24 Aug 2010 19:58:32 +0000 (21:58 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 17 Sep 2010 23:00:14 +0000 (01:00 +0200)
Only enforce property/method body requirements in the case that the
SourceFileType is SOURCE.  This allows fast-vapi to slip through without
complaints.

vala/valamethod.vala
vala/valaparser.vala
vala/valapropertyaccessor.vala

index 5d3cbeb13863c3d68ffcc9a4d5eea4ff7a144262..a29ab05921485bb3a295a97012a6cf15af1fa24e 100644 (file)
@@ -840,7 +840,7 @@ public class Vala.Method : Symbol {
                        Report.error (source_reference, "Extern methods cannot be abstract or virtual");
                } else if (external && body != null) {
                        Report.error (source_reference, "Extern methods cannot have bodies");
-               } else if (!is_abstract && !external && !external_package && body == null) {
+               } else if (!is_abstract && !external && source_type == SourceFileType.SOURCE && body == null) {
                        Report.error (source_reference, "Non-abstract, non-extern methods must have bodies");
                }
 
index eb4755ea2ac1e533bdf74d5a186688a2628b5b9b..b7c9a1a14fbcdb7132936038866c50baa842f97c 100644 (file)
@@ -2825,7 +2825,7 @@ public class Vala.Parser : CodeVisitor {
                }
                expect (TokenType.CLOSE_BRACE);
 
-               if (!prop.is_abstract && !prop.external) {
+               if (!prop.is_abstract && prop.source_type == SourceFileType.SOURCE) {
                        bool empty_get = (prop.get_accessor != null && prop.get_accessor.body == null);
                        bool empty_set = (prop.set_accessor != null && prop.set_accessor.body == null);
 
index ee65a99f858588617c1ff5b4f0c98f2ea94ef890..a1d4763bda8727d801e17c0a2012274861d22436 100644 (file)
@@ -187,7 +187,7 @@ public class Vala.PropertyAccessor : Symbol {
 
                analyzer.current_symbol = this;
 
-               if (!prop.external_package) {
+               if (prop.source_type == SourceFileType.SOURCE) {
                        if (body == null && !prop.interface_only && !prop.is_abstract) {
                                /* no accessor body specified, insert default body */