scan UDA to disable linting: handle useless_initializer check

This commit is contained in:
Axel Ricard 2023-10-06 22:18:01 +02:00
parent 68fd868f26
commit b038879c22

View file

@ -92,7 +92,24 @@ public:
override void visit(const(Declaration) decl)
{
_inStruct.insert(decl.structDeclaration !is null);
const msgDisabled = () {
foreach(attr; decl.attributes)
{
if(this.isCheckDisabled(attr))
{
disableErrorMessage();
return true;
}
}
return false;
}();
decl.accept(this);
if(msgDisabled)
reenableErrorMessage();
if (_inStruct.length > 1 && _inStruct[$-2] && decl.constructor &&
((decl.constructor.parameters && decl.constructor.parameters.parameters.length == 0) ||
!decl.constructor.parameters))