From 2b79fca42e768043a898d548db6d60650df2d403 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sun, 1 Feb 2015 03:08:42 -0800 Subject: [PATCH] False positive on inout @property functions --- src/analysis/function_attributes.d | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/analysis/function_attributes.d b/src/analysis/function_attributes.d index c3b7786..8087310 100644 --- a/src/analysis/function_attributes.d +++ b/src/analysis/function_attributes.d @@ -63,19 +63,21 @@ class FunctionAttributeCheck : BaseAnalyzer bool foundProperty = false; foreach (attribute; dec.attributes) foundConst = foundConst || attribute.attribute.type == tok!"const" - || attribute.attribute.type == tok!"immutable"; + || attribute.attribute.type == tok!"immutable" + || attribute.attribute.type == tok!"inout"; foreach (attribute; dec.memberFunctionAttributes) { foundProperty = foundProperty || (attribute.atAttribute !is null && attribute.atAttribute.identifier.text == "property"); foundConst = foundConst || attribute.tokenType == tok!"const" - || attribute.tokenType == tok!"immutable"; + || attribute.tokenType == tok!"immutable" + || attribute.tokenType == tok!"inout"; } if (foundProperty && !foundConst) { addErrorMessage(dec.name.line, dec.name.column, KEY, "Zero-parameter '@property' function should be" - ~ " marked 'const'."); + ~ " marked 'const', 'inout', or 'immutable'."); } } dec.accept(this);