From 2eddc7a2d296d425b3cb0eecebacafc233b2ab8f Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Tue, 24 Aug 2010 21:58:32 +0200 Subject: [PATCH] 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 5d3cbeb13..a29ab0592 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 eb4755ea2..b7c9a1a14 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 ee65a99f8..a1d4763bd 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 */ -- 2.47.2