diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-10-23 02:21:17 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-10-23 02:21:17 +0800 |
commit | 96b320247788163f7d014404b7b1f089aed82dff (patch) | |
tree | 888558c3cfdc44e427e0f558d071897e38368f18 /changelog.md | |
parent | b6e7d271fcb9c6d807a196d333cd27b920d71f9e (diff) | |
download | lua-language-server-96b320247788163f7d014404b7b1f089aed82dff.zip |
infer type by function as parameters
resolve #1153
Diffstat (limited to 'changelog.md')
-rw-r--r-- | changelog.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md index 2329cdca..2ce0f9c3 100644 --- a/changelog.md +++ b/changelog.md @@ -46,6 +46,18 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`. print(obj.initValue) --> `obj.initValue` is integer ``` +* `CHG` [#1153] infer type by generic parameters or returns of function + ```lua + ---@generic T + ---@param f fun(x: T) + ---@return T[] + local function x(f) end + + ---@type fun(x: integer) + local cb + + local arr = x(cb) --> `arr` is inferred as `integer[]` + ``` * `FIX` [#1567] * `FIX` [#1593] * `FIX` [#1595] @@ -56,6 +68,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`. * `FIX` [#1640] * `FIX` [#1642] +[#1153]: https://github.com/sumneko/lua-language-server/issues/1153 [#1177]: https://github.com/sumneko/lua-language-server/issues/1177 [#1458]: https://github.com/sumneko/lua-language-server/issues/1458 [#1557]: https://github.com/sumneko/lua-language-server/issues/1557 |