Ada: Stop propagation of by-constructor indication during composition.
The Ada compiler now correctly propagates the by-constructor indication only for derived tagged types, not during composition.
The Ada compiler now correctly handles the propagation of the ‘by-constructor’ indication. This indication is now only propagated for derived tagged types and not during composition. This change ensures that the compiler adheres to the correct semantics for type derivation and composition in Ada.
In Details
This commit fixes an issue in sem_ch3.adb related to the propagation of the by-constructor indication during type composition. The Build_Derived_Type function is modified to propagate this indication only for derived tagged types and not for composition. The affected file is sem_ch3.adb.
For Context
In Ada, tagged types are similar to classes in other object-oriented languages, supporting inheritance and polymorphism. When creating new types from existing ones, it's important to correctly track how objects of these types are initialized. This commit addresses an issue in the Ada compiler where the 'by-constructor' indication, which tracks whether a type is initialized using a constructor, was being incorrectly propagated during type composition. This fix ensures correct type semantics during inheritance.