| 1 |
-- { dg-do compile } |
| 2 |
|
| 3 |
procedure Interface6 is |
| 4 |
|
| 5 |
type TI is interface; |
| 6 |
type TI2 is interface; |
| 7 |
|
| 8 |
type Rec_Type is tagged null record; |
| 9 |
|
| 10 |
type Rec_Type1 is new TI |
| 11 |
with |
| 12 |
record |
| 13 |
A : Integer; |
| 14 |
end record; |
| 15 |
|
| 16 |
type Rec_Type2 is new Rec_Type1 and TI2 |
| 17 |
with |
| 18 |
record |
| 19 |
B : Integer; |
| 20 |
end record; |
| 21 |
|
| 22 |
type Rec_Type12 is new Rec_Type1 and TI and TI2 |
| 23 |
with |
| 24 |
record |
| 25 |
C : Integer; |
| 26 |
end record; |
| 27 |
|
| 28 |
generic |
| 29 |
type T is new Rec_Type1 and TI2 with private; |
| 30 |
procedure Test; |
| 31 |
|
| 32 |
procedure Test is |
| 33 |
begin |
| 34 |
null; |
| 35 |
end Test; |
| 36 |
|
| 37 |
procedure Test_Instance1 is new Test (T => Rec_Type); -- { dg-error "actual must implement all interfaces of formal \"T\"" } |
| 38 |
procedure Test_Instance1 is new Test (T => Rec_Type1); -- { dg-error "actual \"Rec_Type1\" must implement interface \"TI2\"" } |
| 39 |
-- { dg-error "instantiation abandoned" "" { target *-*-* } 37 } |
| 40 |
procedure Test_Instance2 is new Test (T => Rec_Type2); |
| 41 |
procedure Test_Instance12 is new Test (T => Rec_Type12); |
| 42 |
|
| 43 |
begin |
| 44 |
null; |
| 45 |
end Interface6; |