Ada: Fix spurious error on primitive function of tagged task type
The Ada compiler no longer incorrectly reports an error related to the controlling result subtype in primitive functions of tagged task types.
The Ada compiler has been fixed to avoid a spurious error when dealing with primitive functions of tagged task types. The issue stemmed from an internal confusion regarding the subtype of the controlling result. The fix involves applying the same processing to the result subtype as is applied to the parameter subtypes. A new test case has been added to verify the fix.
In Details
This commit addresses PR ada/125044, which exposed a bug in sem_disp.adb during the processing of primitive functions of tagged task types. The fix involves ensuring that the result subtype is handled consistently with the parameter subtypes in Check_Controlling_Formals. The root cause was a mismatch in how the compiler internally represented the controlling result's subtype, leading to incorrect error reporting.
For Context
The Ada language supports object-oriented programming with features like tagged types and primitive functions. Tagged types allow for polymorphism and inheritance. This commit fixes a bug in the Ada compiler that caused it to incorrectly report an error when using these features with task types (Ada's way of defining concurrent operations). The fix ensures the compiler correctly handles the relationships between different types in these situations.