3 with Ada
.Text_IO
; use Ada
.Text_IO
;
7 type Field
(Flag
: Boolean := True) is record
9 when True => Param1
: Boolean := False;
10 when False => Param2
: Boolean := True;
14 type Header
(Flag
: Boolean := True) is record
15 Param3
: Integer := 0;
16 Params
: Field
(Flag
) := (if Flag
= True then
17 (Flag
=> True, others => <>)
19 (Flag
=> False, others => <>));
22 type Message
(Flag
: Boolean) is record
24 -- This assignment crashes GNAT
25 The_Header
: Header
(Flag
) := Header
'(Flag => True, others => <>);
30 Put_Line("Hello World");
31 Put_Line (Boolean'Image (It.The_Header.Flag));
32 Put_Line (Boolean'Image (It.The_Header.Params.Flag));