Ada: Improve error message for premature freezing of deferred constant
Enhances the error message for premature freezing of deferred constants by including the constant's name.
This commit improves the error message issued when a deferred constant is prematurely frozen by adding the name of the constant to the message. While a minor change for simple cases, this enhancement will be more helpful in diagnosing the same error in more complex scenarios, providing more context to the user.
In Details
Modifies sem_res.adb (Resolve_Entity_Name) to include the name of the constant in the error message for premature freezing of deferred constants. This minor tweak enhances error reporting in the resolution phase.
For Context
In Ada, a deferred constant is a constant that is declared but not immediately defined; its definition is provided later. Freezing refers to the point at which the properties of an entity (like a constant) become fixed. This commit improves the error message that the compiler generates when a deferred constant is used before its value is known (premature freezing). The improved message now includes the name of the constant, making it easier to identify the source of the error.