Skip to content

Commit

Permalink
fix: Put back lost const check
Browse files Browse the repository at this point in the history
  • Loading branch information
giann committed Feb 25, 2024
1 parent 8003332 commit 0133fb4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4719,6 +4719,10 @@ fn namedVariable(self: *Self, name: Ast.TokenIndex, can_assign: bool) Error!Ast.
else
null;

if (value != null and slot_constant) {
self.reportError(.constant, "Can't assign to constant variable");
}

return try self.ast.appendNode(
.{
.tag = .NamedVariable,
Expand Down

0 comments on commit 0133fb4

Please sign in to comment.