Created attachment 53174 [details] Source from Description This causes ICE with 12.1.0: procedure Container_Aggregates is type Array_Type is array (1 .. 10) of Integer with Aggregate => (Empty => Empty_Array); Empty_Array : constant Array_Type := [1..10 => 123]; begin null; end Container_Aggregates; ICE: % gnatmake -gnat2022 container_aggregates.adb gcc -c -gnat2022 container_aggregates.adb +===========================GNAT BUG DETECTED==============================+ | 12.1.0 (x86_64-apple-darwin15) Program_Error sem_type.adb:837 explicit raise| | Error detected at container_aggregates.adb:7:43 | | Compiling container_aggregates.adb | | Please submit a bug report; see https://gcc.gnu.org/bugs/ . | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact command that you entered. | | Also include sources listed below. | +==========================================================================+
On mainline: +===========================GNAT BUG DETECTED==============================+ | 13.0.0 20220701 (experimental) [master bb6325c8ad2] (x86_64-suse-linux) | | Assert_Failure failed precondition from sinfo-nodes.ads:3970
Same error with iterated element association in aggregate: 597. declare 598. Keys : constant array (Positive range <>) of Integer := [2, 3, 5, 7, 11]; 599. begin 600. 601. -- A map aggregate where the values produced by the 602. -- iterated_element_association are of the same type as the key 603. -- (eliminating the need for a separate key_expression): 604. 605. M := [for Key1 of Keys => Integer'Image (Key1)]; +===========================GNAT BUG DETECTED==============================+ | 12.1.0 (x86_64-apple-darwin19.6.0) Program_Error sem_type.adb:837 explicit raise| | Error detected at aarm_202x_ch04.adb:605:21
reproducer available on https://gitlab.com/adalabs/reproducers/-/tree/main/106037