Invalid bracket encoding reported when using square brackets around strings
Open
Nobody has claimed this yet.
- Dominant language
- Ada
- Stars
- 171
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided Ada 2022 example with the libadalang version included in ALS 2026.0.202510141, focusing on the V3 declaration and its reported error. The fix is complete when the valid single-string square-bracket aggregate is accepted without an "invalid bracket encoding" diagnostic.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100