[vala/0.10-parallel: 32/46] Properties, Methods: Relax some checks



commit 3bac5d18d410c6a8d3568fe1c65eccc4694ca16f
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Aug 24 21:58:32 2010 +0200

    Properties, Methods: Relax some checks
    
    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           |    2 +-
 vala/valaparser.vala           |    2 +-
 vala/valapropertyaccessor.vala |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index 5d3cbeb..a29ab05 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -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");
 		}
 
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index eb4755e..b7c9a1a 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -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);
 
diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala
index ee65a99..a1d4763 100644
--- a/vala/valapropertyaccessor.vala
+++ b/vala/valapropertyaccessor.vala
@@ -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 */
 



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