StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
77 stars 31 forks source link

Rule 0052 does not detect internal procedures being referenced with property syntax #518

Open rvanbekkum opened 8 months ago

rvanbekkum commented 8 months ago

Today I learned you can invoke global procedures with property-syntax, e.g.:

codeunit 70257126 MyCodeunitWithProperty
{
    var
        MyIntegerVariable: Integer;

    internal procedure MyInteger(NewIntegerValue: Integer)
    begin
        MyIntegerVariable := NewIntegerValue;
    end;
}

codeunit 70257127 SampleCodeunit
{
    var
        MyCodeunitWithProperty: Codeunit MyCodeunitWithProperty;

    trigger OnRun()
    begin
        MyCodeunitWithProperty.MyInteger := 42;
    end;
}

For this sample, rule 0052 does not detect that the internal procedure is referenced.

pri-kise commented 8 months ago

I think this is feature is limited to simple types like, Text, Integer, BigInteger and the procedure must only have one paramter.