Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Is there a way to specify type aliases for variadic arg functions

未關閉
#3,252 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
lua
領域
tooling

研究方向

從提供的 LuaLS 重現開始,將推斷出的型別與預期的可變參數函式簽章進行比較。追蹤 Predicate1–Predicate4 別名範例,以確定泛型與可變參數別名推斷目前的限制;完成的標準是確定是否需要受支援的語法,或是否需要對推斷進行更廣泛的變更。

由索引模型根據 Issue 內容生成。

描述

Is there any way to achieve proper inference of variadic arguments using aliases?

Image

a should be fun(a: table, b: string, c: integer): boolean but instead it's fun(...: table): boolean

I've also tried but it didn't work

--- @alias Predicate1<A> fun(a: A): boolean
--- @alias Predicate2<A, B> fun(a: A, b: B): boolean
--- @alias Predicate3<A, B, C> fun(a: A, b: B, c: C): boolean
--- @alias Predicate4<A, B, C, D> fun(a: A, b: B, c: C, d: D): boolean

--- @alias Predicate<A, B, C, D>
--- | Predicate1<A>
--- | Predicate2<A, B>
--- | Predicate3<A, B, C>
--- | Predicate4<A, B, C, D>
主要語言
Lua
星號
4.4k
分支
442
平均合併
8 天 9 小時
30 天內合併 PR
1

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

LuaLS/lua-language-server 的其他 Issue

查看 LuaLS/lua-language-server 的全部 Issue

相似的 Issue

更多 Lua Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。