procedure Main is
   package Shapes is
      type Shape is tagged record
         X : Integer := 0;
      end record;

      type Rectangle is new Shape with record
         W : Natural := 1;
      end record;

      type Circle is new Shape with record
         R : Natural := 1;
      end record;
   end Shapes;
   use Shapes;

   function Width (S : Shape'Class) return Natural is (Rectangle (S).W);

   C : constant Circle := (X => 0, R => 2);
   N : Natural;
begin
   N := Width (C);
end Main;
