[vala/parallel: 11/17] Properties, Methods: relax some checks



commit e1661770ef48659ae5c599025b164b5326ad7bd2
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 29f30ab..8b822e3 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -802,7 +802,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 a307b53..5b9c7aa 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -2722,7 +2722,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]