Skip to content

Commit

Permalink
Merge branch 'mr/limited_fix' into 'edge'
Browse files Browse the repository at this point in the history
Do not use an access type discriminant for a mutable type

See merge request eng/ide/ada_language_server!1648
  • Loading branch information
setton committed Aug 2, 2024
2 parents f366015 + 11aa92a commit e2d1c53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions liblsp_base/source/lsp-json_streams.ads
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ with VSS.Text_Streams;
package LSP.JSON_Streams is
-- pragma Elaborate_Body;

type JSON_Reader is access all VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class;

type JSON_Stream
(Is_Server_Side : Boolean := False;
R : access VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class := null)
R : JSON_Reader := null)
is limited new Ada.Streams.Root_Stream_Type with private;
-- Stream implemented over JSON document
--
Expand Down Expand Up @@ -106,7 +108,7 @@ private

type JSON_Stream
(Is_Server_Side : Boolean := False;
R : access VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class := null)
R : JSON_Reader := null)
is limited new Ada.Streams.Root_Stream_Type with
record
W : Write_Stream;
Expand Down
2 changes: 1 addition & 1 deletion source/client/lsp-clients.adb
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ package body LSP.Clients is
use all type VSS.JSON.Streams.JSON_Stream_Element_Kind;

R : aliased VSS.JSON.Pull_Readers.Simple.JSON_Simple_Pull_Reader;
JS : aliased LSP.JSON_Streams.JSON_Stream (False, R'Access);
JS : aliased LSP.JSON_Streams.JSON_Stream (False, R'Unchecked_Access);

begin
R.Set_Stream (Memory'Unchecked_Access);
Expand Down

0 comments on commit e2d1c53

Please sign in to comment.