-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
kind:bugA bug in the code. Does not apply to documentation, specs, etc.A bug in the code. Does not apply to documentation, specs, etc.topic:compiler:parser
Description
Summary
The parser appears to silently ignore &( ), &[ ], and &{ } when they appear in assignments.
Reproduction
x &(a) = 1
y &[b] = 2
z &{c} = 3
p! x, y, zExpected behavior
The compiler should raise a syntax error, because &(a), &[b], and &{c} are not valid syntax in this context.
Actual behavior
The code compiles and runs, producing:
x # => 1
y # => 2
z # => 3
It seems that &(a), &[b], and &{c} are simply ignored by the parser.
Crystal version
> crystal --version
Crystal 1.19.1 [a3178c3] (2026-01-20)
LLVM: 20.1.7
Default target: x86_64-pc-windows-msvc
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind:bugA bug in the code. Does not apply to documentation, specs, etc.A bug in the code. Does not apply to documentation, specs, etc.topic:compiler:parser