GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
ada

Ada: Enable overloading resolution for Last and Previous in Iterable aspects

Fixes overloading resolution for `Last` and `Previous` primitives in Ada's `Iterable` aspects.

This commit corrects the overloading resolution for the Last and Previous operations in Ada’s Iterable aspects, ensuring they are handled consistently with other primitives like Next and First. This allows developers to define and use these operations in a more flexible and intuitive manner within the context of iterable types.

In Details

The Ada compiler must correctly resolve overloaded operations based on the context in which they are used. This commit addresses an issue in sem_ch13.adb where the overloading resolution for Last and Previous operations of an Iterable aspect was not being handled correctly. This fix ensures consistency with the handling of Next and First operations, improving the compiler's type resolution capabilities.

For Context

In Ada, overloading allows multiple subprograms or operators to have the same name, as long as their parameter lists differ. This commit fixes a problem in the Ada compiler that was preventing the correct resolution of overloaded Last and Previous operations when working with Iterable types. By ensuring these operations are treated consistently with others, the compiler enables more flexible and correct code when using iterators.

Filed Under: adaoverloadingiterable