We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
for .. in
1 parent 744156b commit 3fef099Copy full SHA for 3fef099
changelog.md
@@ -5,7 +5,7 @@
5
6
## 3.16.4
7
* `FIX` (VSCode) Broken `view document`
8
-
+* `FIX` `for .. in` should only treat the first variable as const
9
10
## 3.16.3
11
`2025-12-23`
script/parser/compile.lua
@@ -4098,9 +4098,9 @@ local function parseFor()
4098
for i = 1, #list do
4099
local obj = list[i]
4100
---@cast obj parser.object
4101
- -- In Lua 5.5, for loop variables are treated as constants
+ -- In Lua 5.5, for first loop variable is treated as constant
4102
local attrs
4103
- if State.version == 'Lua 5.5' then
+ if i == 1 and State.version == 'Lua 5.5' then
4104
attrs = {
4105
type = 'localattrs',
4106
start = obj.start,
0 commit comments