I created the following example:
procedure Example is
type Index_Type is range 1 .. 3;
type Array_Type is array (Index_Type) of Integer;
Array_Fail_One : Array_Type := (11, 22, 33, 44);
Array_Fail_Two : Array_Type := (1 => 11, 2 => 22, 3 => 33, 4 => 44);
begin
null;
end Example;
Why is thind kind of problem only treated as a warning and not as an error?
example.adb:6:35: warning: upper bound of aggregate out of range
example.adb:6:35: warning: Constraint_Error will be raised at run time
example.adb:7:35: warning: upper bound of aggregate out of range
example.adb:7:35: warning: Constraint_Error will be raised at run time