Life as an X++ developer just got a bit easier. We have been ironing out some of the wrinkles regarding access specifiers in the X++ compiler lately. Most X++ developers might not have noticed, and might wonder: Didn’t it work like that already? Now it does – better letter than never. The goal is to be just C# - no surprises or idiosyncrasies required.
Marking a method as internal ought to let you keep full control of the method. However, the compiler has not enforced the internal keyword in all cases, and thereby accepting external references. We will be hardening the compiler to first give warnings, and shortly thereafter give errors. We must close the hole before it spins out of control. The scope of this problem is proportional to the number of internal methods; which is exponentially increasing. We are aware of very few cases that can impact external parties; and are reaching out proactively.
It is now possible to change a from protected to protected internal without risking breaking anyone. Recall that protected internal is the union of protected and internal, the act of marking a protected method as protected internal must not limit any capabilities.
It is now possible to mark a method with InternalUseOnly to signal the intent-to-make-internal; just like SysObsolete(<Reason>, false) can be used to signal the intent-to-deprecate a method. In both cases consumers will receive a warning – effectively giving a grace period to react.
All changes are in the compiler; and therefore, not affecting binary compatibility or updates of production environments.