[valadoc] libvaladoc: accept @return in constructors
- From: Florian Brosch <flobrosch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [valadoc] libvaladoc: accept @return in constructors
- Date: Mon, 6 Aug 2012 21:20:55 +0000 (UTC)
commit 4045ba965b142af50ddd1eeab245686b416c9672
Author: Florian Brosch <flo brosch gmail com>
Date: Mon Aug 6 21:54:53 2012 +0200
libvaladoc: accept @return in constructors
src/libvaladoc/taglets/tagletreturn.vala | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/libvaladoc/taglets/tagletreturn.vala b/src/libvaladoc/taglets/tagletreturn.vala
index 163f0ba..655fb7a 100644
--- a/src/libvaladoc/taglets/tagletreturn.vala
+++ b/src/libvaladoc/taglets/tagletreturn.vala
@@ -32,7 +32,10 @@ public class Valadoc.Taglets.Return : InlineContent, Taglet, Block {
public override void check (Api.Tree api_root, Api.Node container, string file_path, ErrorReporter reporter, Settings settings) {
Api.TypeReference? type_ref = null;
+ bool creation_method = false;
+
if (container is Api.Method) {
+ creation_method = ((Api.Method) container).is_constructor;
type_ref = ((Api.Method) container).return_type;
} else if (container is Api.Delegate) {
type_ref = ((Api.Delegate) container).return_type;
@@ -42,7 +45,7 @@ public class Valadoc.Taglets.Return : InlineContent, Taglet, Block {
reporter.simple_warning ("%s: %s: @return: warning: @return used outside method/delegate/signal context", file_path, container.get_full_name ());
}
- if (type_ref != null && type_ref.data_type == null) {
+ if (type_ref != null && type_ref.data_type == null && !creation_method) {
reporter.simple_warning ("%s: %s: @return: warning: Return description declared for void function", file_path, container.get_full_name ());
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]