summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-12-01 17:08:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-12-01 17:08:38 +0800
commit018ee6b9d5be0b58ffb04796b3910bf7f1b03e6a (patch)
treec31bbe473ccbf50b2ad0978410dc396e313207d3
parent8581187a7af6fdce6b26a043014827bb078705e5 (diff)
downloadlua-language-server-018ee6b9d5be0b58ffb04796b3910bf7f1b03e6a.zip
fix #815
-rw-r--r--changelog.md1
-rw-r--r--script/core/noder.lua7
-rw-r--r--test/type_inference/init.lua4
3 files changed, 12 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md
index 0df1e08b..6a447922 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,6 +1,7 @@
# changelog
## 2.5.2
+* `FIX` [#815](https://github.com/sumneko/lua-language-server/issues/815)
* `FIX` [#825](https://github.com/sumneko/lua-language-server/issues/825)
* `FIX` [#827](https://github.com/sumneko/lua-language-server/issues/827)
* `FIX` [#837](https://github.com/sumneko/lua-language-server/issues/837)
diff --git a/script/core/noder.lua b/script/core/noder.lua
index bc2efa70..a3fdd278 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -1341,6 +1341,13 @@ compileNodeMap = util.switch()
pushForward(noders, id, getID(parent))
end
end)
+ : case 'loop'
+ : call(function (noders, id, source)
+ local loc = source.loc
+ if loc then
+ pushForward(noders, getID(loc), 'dn:integer')
+ end
+ end)
: case 'in'
: call(function (noders, id, source)
local keys = source.keys
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 36357771..574c2c12 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -1053,3 +1053,7 @@ f {
}
}
]]
+
+TEST 'integer' [[
+for <?i?> = a, b, c do end
+]]