LuaLS / LuaLS/lua-language-server

泛型和alias联合使用的问题

Open
#3,196 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

### Issue Description

![Image](https://github.com/user-attachments/assets/b529a786-ee99-4b98-9bd2-99fee32c7f37)

### Additional Notes

使用泛型返回alias类型似乎没有办法正确的返回类型, 我希望在new中传入类名创建对象,并且强制调用init才能返回对象,不过没有找到正确的注释办法

Contributor guide

Open the contributing guide

Research direction

No source file or test is named; start by reproducing the generic-and-alias type result described in the issue and tracing the language server's handling of the `new` call and `init`. Done means the annotation expresses the intended class-name construction and the returned object type is inferred correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.