procedure Main is
subtype str5 is string(1..5);
type s5_ptr is access all str5;
type T is
--current : access str5;
current : s5_ptr; -- "aliased actual has wrong accessibility"
foo : aliased str5;
The accessibility rules are far too complicated and unreadable (I'm not about trying to grock them), but the component current has a type that has a lifetime as long as Main. Your object o may be declared in an inner scope with less lifetime. Thus theassignment must be illegal.
I'm trying to learn the 2012 changes to accessibility rules, ......
Does anyone know off hand which is the correct behavior?
function F (y : aliased in out str5) return access str5 is
procedure P (x : in out T) is
x.current := F(x.foo);
|Location:||Huddersfield, West Yorkshire, UK|
|Nodes:||16 (2 / 14)|