Skip to content

Invalid bracket encoding reported when using square brackets around strings #977

@liampwll

Description

@liampwll

Libadalang appears to treat any single string wrapped in square brackets as invalid, reporting "invalid bracket encoding". See the following valid code as an example:

pragma Ada_2022;

with Ada.Containers.Vectors;

procedure Example is
   type String_1 is new String (1 .. 1);

   package String_Vec is new Ada.Containers.Vectors (Positive, String_1);
   package Integer_Vec is new Ada.Containers.Vectors (Positive, Integer);

   V1 : String_Vec.Vector := ["a", "b"];
   V2 : Integer_Vec.Vector := [1];
   V3 : String_Vec.Vector := ["a"]; --  Error here
begin
   null;
end Example;

This has only been tested against the version of libadalang included in ALS 2026.0.202510141.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions