Debian Codegraph @

gcc/testsuite/gnat.dg/specs/aggr9.ads

raw
1 -- PR ada/123289
2 -- { dg-do compile }
3 -- { dg-options "-gnat2022" }
4
5 package Aggr9 is
6
7 type JSON_Value is tagged null record;
8 type JSON_Object is new JSON_Value with null record
9 with Aggregate => (Empty => Empty, Add_Named => Insert); -- { dg-error "exactly one" }
10 type JSON_Integer is new JSON_Value with null record
11 with Integer_Literal => From_Universal_Image;
12
13 function Empty return JSON_Object
14 is (null record);
15
16 procedure Insert
17 (O : in out JSON_Object; Key : String; Value : JSON_Integer'Class)
18 is null;
19
20 procedure Insert (O : in out JSON_Object; Key : String; Value : String)
21 is null;
22
23 function From_Universal_Image (Value : String) return JSON_Integer
24 is (null record);
25
26 end Aggr9;