3 procedure Test_Self_Ref
is
5 type T2_Ref
is access all T2
;
7 function F
(X
: T2_Ref
) return Integer;
9 type T2
is limited record
10 Int1
: Integer := F
(T2
'Unchecked_Access);
11 Int2
: Integer := F
(T2
'Unrestricted_Access);
14 Counter
: Integer := 2;
16 function F
(X
: T2_Ref
) return Integer is
18 Counter
:= Counter
* 5;
22 Obj1
: T2_Ref
:= new T2
'(10,20);
23 Obj2 : T2_Ref := new T2;
24 Obj3 : T2_Ref := new T2'(others => <>);
27 if Obj1
.Int1
/= 10 or else Obj1
.Int2
/= 20 then
30 if Obj2
.Int1
/= 10 or else Obj2
.Int2
/= 50 then
33 if Obj3
.Int1
/= 250 or else Obj3
.Int2
/= 1250 then