Allow 'immutable' to count towards the property check
This commit is contained in:
parent
93b3873ae0
commit
90fe5f65ef
|
@ -62,12 +62,14 @@ class FunctionAttributeCheck : BaseAnalyzer
|
||||||
bool foundConst = false;
|
bool foundConst = false;
|
||||||
bool foundProperty = false;
|
bool foundProperty = false;
|
||||||
foreach (attribute; dec.attributes)
|
foreach (attribute; dec.attributes)
|
||||||
foundConst = foundConst || attribute.attribute.type == tok!"const";
|
foundConst = foundConst || attribute.attribute.type == tok!"const"
|
||||||
|
|| attribute.attribute.type == tok!"immutable";
|
||||||
foreach (attribute; dec.memberFunctionAttributes)
|
foreach (attribute; dec.memberFunctionAttributes)
|
||||||
{
|
{
|
||||||
foundProperty = foundProperty || (attribute.atAttribute !is null
|
foundProperty = foundProperty || (attribute.atAttribute !is null
|
||||||
&& attribute.atAttribute.identifier.text == "property");
|
&& attribute.atAttribute.identifier.text == "property");
|
||||||
foundConst = foundConst || (attribute.tokenType == tok!"const");
|
foundConst = foundConst || attribute.tokenType == tok!"const"
|
||||||
|
|| attribute.tokenType == tok!"immutable";
|
||||||
}
|
}
|
||||||
if (foundProperty && !foundConst)
|
if (foundProperty && !foundConst)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue