It's not needless; there is an implicit conversion on an assignment, and it only needs to work one way. When you rename a variable, the conversion has
to work both ways. But that's problematic, since conversions often involve checks and we don't want checks popping up in unexpected places (both for implementation reasons and for readability reasons).
Also, renaming does not change the nominal subtype of an object, regardless
of what subtype is given in the renames. Ada 2022 allows you to omit the
type name altogether since it provides little value.
Randy.
"Simon Belmont" <
[email protected]> wrote in message news:
[email protected]...
On Thursday, September 21, 2023 at 5:03:06?PM UTC-4, G.B. wrote:
O does not denote an object of a class-wide type,
I think. However, P'Class (o) does, so that renaming
that would make r be of its declared type P'Class.
That seems needlessly pedantic, considering that assignment is fine (o2 : P'Class := o) as well as assigning it to an intermediate pointer (po :
access P'Class := o'Access; r : P'Class renames po.all)
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)