Closed dzzzb closed 2 years ago
To confirm, I can still replicate this, and have now isolated it from the original project/context:
table 50100 Test
{
fields
{
field(20; "Record ID"; RecordId) { }
field(30; "Due Date"; Date) { }
}
}
codeunit 50100 Test
{
trigger OnRun()
var
Test: Record Test;
NullRecordId: RecordId;
begin
FindSetAfter(Test, NullRecordId, WorkDate());
end;
local procedure FindSet(var Test: Record Test; RecordId: RecordId): Boolean
begin
Test.SetRange("Record ID", RecordId);
exit(Test.FindSet(false));
end;
local procedure FindSetAfter(var Test: Record Test; RecordId: RecordId; FirstDueDate: Date): Boolean
begin
Test.SetFilter("Due Date", '>%1', FirstDueDate);
exit(FindSet(Test, RecordId));
end;
}
Name: AL Language
Id: ms-dynamics-smb.al
Description: AL development tools for Dynamics 365 Business Central
Version: 8.2.550913
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al
still an issue with AL 8.4.586670
perhaps related: https://github.com/microsoft/AL/issues/6962 for unrelated procs named SetLoadFields()
Thanks for reporting this issue. Sorry we haven’t completed it yet, but we’ve had to prioritize elsewhere. We’re planning to give the CodeCop engine and its rules an overhaul in a future major release. Thanks for your patience.
1. Describe the bug I made a helper function named
FindSet()
, which compiles fine, but it seems the rule AA0181 sees the wordFindSet
and falsely concludes I'm breaking it.I'm not! The function takes a
var
record on which I will iterate withNext()
later.Renaming my function silences this spurious warning.
2. To Reproduce This code gives the bug:
Renaming the helper function avoids it:
3. Expected behavior No warning, because I'm not doing anything wrong here, and the analyser should only analyse calls to
Record.FindFirst()
, not users' functions with the same name.4. Actual behavior See above.
5. Versions: