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
747 stars 245 forks source link

Explicit `Rec.` prefix on unsupported runtime not caught at compile time, may freeze client #6426

Open dzzzb opened 3 years ago

dzzzb commented 3 years ago

Describe the bug If a page has added explicit Rec. qualifiers to fields or properties, these are not supported in runtimes before 6, but there are no warnings at compile-time, so if we backport an extension or just include Rec. out of habit to an older runtime, we find only later that it doesn't work, and have to waste our time and disturb users by republishing without Rec.

Worse, not all unsupported cases are even reported at runtime, at least not until you go looking elsewhere... for example, I just found that Rec. in a HideValue expression just causes the client to lock up and spew a bunch of errors in an infinite loop!

image

To Reproduce Here is the page after I mostly fixed it but forgot the Rec. in the HideValue expression, which caused the inability to open the page as it silently spun an infinite loop as per above. image

Expected behavior If compiling against a runtime that doesn't support Rec. anywhere, stop the developer with an error, rather than deferring that until runtime and wasting everyone's time. Please?

5. Versions:

atoader commented 3 years ago

@dtkb is this still a problem?

dzzzb commented 3 years ago

Yes, the compiler still doesn't warn that unsupported Rec. prefixes will either cause a runtime error or simply crash the client. Same example, redone:

image

I would expect that

Name: AL Language
Id: ms-dynamics-smb.al
Description: AL development tools for Dynamics 365 Business Central
Version: 7.1.453917
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al