Skip to content

Commit

Permalink
Resolve false positive (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthurvdv authored Jan 7, 2025
1 parent 655949a commit f0f05ce
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions BusinessCentral.LinterCop.Test/Rule0075.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public async Task HasDiagnostic(string testCase)
[TestCase("ImplicitConversiontIntegerToEnum")]
[TestCase("ImplicitConversiontLabelToCode")]
[TestCase("RecordGetBuiltInMethodRecordId")]
[TestCase("RecordGetCode10ToCode20")]
[TestCase("RecordGetFieldRecordId")]
[TestCase("RecordGetGlobalVariable")]
[TestCase("RecordGetLocalVariable")]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
codeunit 50100 MyCodeunit
{
procedure MyProcedure(MyCode: Code[10])
var
MyTabe: Record MyTabe;
begin
[|MyTabe.Get(MyCode)|];
end;
}

table 50100 MyTabe
{
fields
{
field(1; MyField; Code[20]) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private bool AreFieldCompatible(IArgument argument, IFieldSymbol field)
if (argumentNavType == NavTypeKind.Enum && fieldNavType == NavTypeKind.Enum)
return argumentType.OriginalDefinition == fieldType.OriginalDefinition;

if ((argumentNavType == fieldNavType && argumentType.Length == fieldType.Length) ||
if ((argumentNavType == fieldNavType && argumentType.Length <= fieldType.Length) ||
argumentNavType == NavTypeKind.None ||
argumentNavType == NavTypeKind.Joker)
return true;
Expand Down

0 comments on commit f0f05ce

Please sign in to comment.