22
I would love to see the "support for Variants passed by reference" added to the AL language to enable some nice implementations supporting different source records.

To return Complex Types are usefull, too, but at the moment they are very cost intensive since they result in a copy of a Record.

Related Improvements for the System Applications (and there might more cool possibilities)
https://github.com/microsoft/ALAppExtensions/pull/9874
https://github.com/microsoft/ALAppExtensions/pull/12281

This is only one scenario as example, but I could imagine more since the support of "var variant" would give use many possibilites to write more flexible code.
Category: Development
STATUS DETAILS
Declined
Ideas Administrator

Thank you for this suggestion! As this idea tracks two parts, one support and the other having a different idea, this entry is resolved as rejected, although having slightly more votes. If you are looking to for boxing/unboxing then vote on 
https://experience.dynamics.com/ideas/idea/?ideaid=08a6c1b1-2583-eb11-8ced-0003ff45ceba

Comments

K

...and that phrasing of it was already filed here: https://experience.dynamics.com/ideas/idea/?ideaid=08a6c1b1-2583-eb11-8ced-0003ff45ceba

Category: Development

K

`var Variant` parameters are supported fine. I guess what you really mean is automatic un/boxing between any other arbitrary type and a `var Variant` parameter, where the compiler would handle assigning the source object to the Variant on entry to the function, and back again on exit. That might be quite complicated to provide as a feature of the language, hence why it's currently left to us developers to do it manually. It'd be nice if it could be solved in a tidy, non-risky or non-breaking way, but I don't know whether that's possible.

Category: Development