Ensure consistent handling of Master_Id for anonymous access result types
This commit standardizes the handling of `Master_Id` for anonymous access result types in Ada to improve consistency.
This commit addresses a small irregularity in how Master_Id is handled for anonymous access result types. It ensures that the Master_Id is always set to a renaming of the current _Master variable, even for anonymous access result types, resolving an ambiguity in .dg files and improving consistency in the compiler’s internal representation.
In Details
The change modifies exp_ch9.adb and sem_ch6.adb. Previously, anonymous access result types had their Master_Id set directly to the current _Master variable, while other access types used a renaming via Build_Master_Renaming. The commit introduces Build_Master_Renaming_Declaration to create a renaming declaration for anonymous access result types as well, ensuring uniformity.
For Context
In Ada, an 'access type' is similar to a pointer in other languages, allowing you to refer to a variable indirectly. Anonymous access result types are access types returned by a function where the type itself doesn't have a name. Master_Id is an internal identifier related to task management (specifically, masters and dependents). This commit standardizes how the compiler handles this identifier for anonymous access types, leading to more predictable behavior.