--  Operands, choices and selectors whose types come from the rest of the construct (RM
--  8.6): catenation operands from the context, a membership's operand from its choices, a
--  case selector of the one discrete type, a conditional expression of its branches' common
--  type, a string literal of an array of characters, a character literal of the expected
--  type, a real range bound of its one real type, and a literal operand from the other one.
with Ada.Text_IO;
procedure Main is
   type Rec is record
      X : Integer;
   end record;
   type Arr is array (Positive range <>) of Rec;
   R1 : constant Rec := (X => 1);
   R2 : constant Rec := (X => 2);
   V : constant Arr (1 .. 4) := R1 & R2 & (R1 & R2);
   S : constant String := "ABC" & (7 .. 8 => 'D');
   type T is ('S', 'Q', 'P', 'M', 'R');
   subtype ST is T range 'P' .. 'R';
   type Month is (Jan, Feb, Mar);
   type Shape is (Tri, Sqr);
   function Item return Month is (Feb);
   function Item return Shape is (Tri);
   type Short is range -10 .. 10;
   function Zero return Float is (0.0);
   function Zero return Short is (0);
   type Radix is (Bin, Oct, Dec);
   type Season is (Jun, Oct, Dec);
   type Enum is (A, B, C);
   type Enum_Vec is array (1 .. 6) of Enum;
   procedure Put (X : String) is
   begin
      Ada.Text_IO.Put_Line (X);
   end Put;
   procedure Put (X : Enum_Vec) is null;
   package P is
      type Mixed is ('A', 'B', None);
   end P;
   M : constant P.Mixed := 'B';
   function "+" (X, Y : Float) return Integer is (0);
   type R1_Type is digits 2 range 0.0 .. 1.0 + Float'(1.0);
   type Bit is new Boolean;
   X : constant Bit := True;
   N : Integer := 0;
begin
   pragma Assert (V (3).X = 1 and S = "ABCDD");
   pragma Assert (not ('Q' in ST) and Item in Jan .. Mar);
   case Zero is
      when 0 => N := 1;
      when others => N := 2;
   end case;
   case (if N < 1 then Jun elsif N < 8 then Oct else Dec) is
      when Jun => N := N + 10;
      when Oct => N := N + 20;
      when Dec => N := N + 30;
   end case;
   Put ("STRING");
   pragma Assert (P.Mixed'Pos (M) = 1 and R1_Type'Last = 2.0);
   if (False or X) /= True then
      N := 0;
   end if;
   Ada.Text_IO.Put_Line (Integer'Image (N));
end Main;
