1-- { dg-do compile } 2 3with Limited_With4_Pkg; 4 5package body Limited_With4 is 6 7 procedure Proc1 (A : Limited_With4_Pkg.Rec12 ; I : Integer) is 8 begin 9 if A.R.I /= I then 10 raise Program_Error; 11 end if; 12 end; 13 14 function Func1 (I : Integer) return Limited_With4_Pkg.Rec12 is 15 begin 16 return (I => I, R => (I => I)); 17 end; 18 19 procedure Proc2 (A : Limited_With4_Pkg.Rec22 ; I : Integer) is 20 begin 21 if A.R.I /= I then 22 raise Program_Error; 23 end if; 24 end; 25 26 function Func2 (I : Integer) return Limited_With4_Pkg.Rec22 is 27 begin 28 return (I => I, R => (I => I)); 29 end; 30 31 procedure Proc3 (A : Limited_With4_Pkg.Rec12 ; B : Limited_With4_Pkg.Rec22) is 32 begin 33 if A.R.I /= B.R.I then 34 raise Program_Error; 35 end if; 36 end; 37 38 function Func3 (A : Limited_With4_Pkg.Rec12) return Limited_With4_Pkg.Rec22 is 39 begin 40 return (I => A.R.I, R => (I => A.R.I)); 41 end; 42 43end Limited_With4; 44