fix auto_function autofix for `auto ref fn()`

This commit is contained in:
WebFreak001 2023-07-13 16:59:35 +02:00 committed by Jan Jurzitza
parent f22b2e587c
commit c8262f4220
1 changed files with 4 additions and 1 deletions
src/dscanner/analysis

View File

@ -82,7 +82,8 @@ public:
}
else
addErrorMessage(autoTokens, KEY, MESSAGE,
[AutoFix.replacement(autoTokens[0], "void")]);
[AutoFix.replacement(autoTokens[0], "", "Replace `auto` with `void`")
.concat(AutoFix.insertionAt(decl.name.index, "void "))]);
}
}
@ -277,12 +278,14 @@ unittest
assertAutoFix(q{
auto ref doStuff(){} // fix
auto doStuff(){} // fix
@property doStuff(){} // fix
@safe doStuff(){} // fix
@Custom
auto doStuff(){} // fix
}c, q{
ref void doStuff(){} // fix
void doStuff(){} // fix
@property void doStuff(){} // fix
@safe void doStuff(){} // fix