File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
testsuite/tests/ada_api/generic_api Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ package body Langkit_Support.Generic_API is
144
144
145
145
function Token_Kind_Name (Kind : Token_Kind_Ref) return Name_Type is
146
146
begin
147
+ Check_Token_Kind (Kind);
147
148
return Create_Name (Kind.Id.Token_Kinds (Kind.Index).Name.all );
148
149
end Token_Kind_Name ;
149
150
Original file line number Diff line number Diff line change 90
90
end loop ;
91
91
New_Line;
92
92
93
+ Put_Line (" Use of null token kind:" );
94
+ declare
95
+ Dummy : Name_Type;
96
+ begin
97
+ Dummy := Token_Kind_Name (No_Token_Kind_Ref);
98
+ raise Program_Error;
99
+ exception
100
+ when Exc : Precondition_Failure =>
101
+ Put_Line (" Got a Precondition_Failure exception: "
102
+ & Exception_Message (Exc));
103
+ end ;
104
+ New_Line;
105
+
93
106
Put_Line (" Use of null context:" );
94
107
declare
95
108
Dummy : Boolean;
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ Token families:
51
51
Punctuation
52
52
Default_Family
53
53
54
+ Use of null token kind:
55
+ Got a Precondition_Failure exception: null token kind reference
56
+
54
57
Use of null context:
55
58
Got a Precondition_Failure exception: null context
56
59
You can’t perform that action at this time.
0 commit comments