--  A case over a record component covers the component's subtype (RM 5.4(7)), and SPARK's
--  'Update is Ada 2022's delta aggregate.
with Ada.Text_IO;
procedure Main is
   type Cell is (Empty, I, O, J, L, S, T, Z);
   subtype Shape is Cell range I .. Z;
   type Piece is record
      S : Shape := I;
      X : Integer := 0;
   end record;
   P : Piece := (S => O, X => 1);
   N : Integer := 0;
begin
   case P.S is
      when I | O => N := 1;
      when J .. Z => N := 2;
   end case;
   P := P'Update (X => 5, S => T);
   Ada.Text_IO.Put_Line (Integer'Image (N) & Integer'Image (P.X) & " " & Cell'Image (P.S));
end Main;
