microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
744 stars 245 forks source link

AA0211 should error for standard, non-FlowField/Blob passed to SetAutoCalcFields(), etc. #6479

Closed dzzzb closed 2 years ago

dzzzb commented 3 years ago

This rule correctly catches non-FlowField/-Blob fields passed to CalcFields(), but it does not warn for SetAutoCalcFields(), instead resulting in a runtime error. It should warn for both, thus stopping developers from publishing a wrong SetAutoCalcFields() and only finding out later.

Saying that: if the current diagnosed case is a runtime error, why is it only a compile-time warning? If that code cannot possibly work at runtime, don't let devs think they can ignore the 'warning', because it will just be transmuted into an error later, thus again wasting our time. That is: make any such attempt to calc a non-flowfield be a compile error

Edit: This should also apply to other places where one can specify CalcFields, e.g. in a Report dataitem. Please ensure that it does.

image

image

mazhelez commented 2 years ago

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.