is it really illegal to rename an object as it's classwide parent? gnat claims so. Similar results using a type extension as a generic formal "in out" object of classwide type.
declare
type P is interface;
type C is new P with null record;
o : C;
r : P'Class renames o; --error
begin
null;
end;
expected type "P'Class" defined at line
found type "C" defined at line
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.
r : P'Class renames o; --error
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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (2 / 14) |
Uptime: | 65:08:51 |
Calls: | 8,355 |
Calls today: | 15 |
Files: | 13,159 |
Messages: | 5,893,953 |
Posted today: | 1 |