elsif T2 = Any_Composite and then Is_Aggregate_Type (T1) then
return True;
- -- In Ada_2022, an aggregate is compatible with the type that
- -- as the corresponding aspect.
+ -- In Ada 2022, an aggregate is compatible with the type that
+ -- has the corresponding aspect.
elsif Ada_Version >= Ada_2022
and then T2 = Any_Composite
or else (T1 = Any_Character and then Is_Character_Type (T2))
or else (T1 = Any_String and then Is_String_Type (T2))
or else (T1 = Any_Composite and then Is_Aggregate_Type (T2))
+ or else (Ada_Version >= Ada_2022
+ and then T1 = Any_Composite
+ and then Has_Aspect (T2, Aspect_Aggregate))
then
return B2;
or else (T2 = Any_Character and then Is_Character_Type (T1))
or else (T2 = Any_String and then Is_String_Type (T1))
or else (T2 = Any_Composite and then Is_Aggregate_Type (T1))
+ or else (Ada_Version >= Ada_2022
+ and then T2 = Any_Composite
+ and then Has_Aspect (T1, Aspect_Aggregate))
then
return B1;
--- /dev/null
+-- PR ada/123861
+-- { dg-do compile }
+-- { dg-options "-gnat2022" }
+
+with Ada.Containers.Vectors;
+
+package Aggr11 is
+
+ package Vectors is new Ada.Containers.Vectors (Positive, Integer);
+ use Vectors;
+
+ A : constant Vector := [];
+ B : constant Boolean := [] = A; -- ICE
+ C : constant Boolean := Vector'[] = A; -- Works
+ D : constant Boolean := A = []; -- Works
+
+end Aggr11;