Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`@overload` does not cooperate with `@class` when adding overloads to an inherited class method

オープン
#3,364 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
lua
領域
devtools

調査の方向性

再現で示されている Lua のアノテーションと補完の動作から始め、@class の継承と @overload 宣言がどのように処理されるかに注目してください。NeoVim でこのケースを再現し、補完とホバーの両方に、継承された "bar" overload と子の "baz" overload が、パラメーター型の不一致なしで表示されることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Completion

Expected Behaviour

Adding an overload to a function inherited from another class should result in both the parent class' overloads and the new overload being suggested as autocomplete and hover tooltip entries.

Actual Behaviour

Adding an overload to a function inherited from another class makes that overload the only one that is recognized for the current class.

Reproduction steps
---@meta

---@class ParentClass
ParentClass = {}

---@param arg string
---@return unknown
---@overload fun(self, arg: "bar"): boolean
function ParentClass:foo(arg) end

---@class ChildClass : ParentClass
---@field foo fun(self, arg: "baz"): number
ChildClass = {}

ChildClass:foo(--[[Should suggest both "bar" and "baz", but only suggests "baz" and "bar" raises a param-type-mismatch]])

Redefining the function and adding an @overload there yields the same result.

Additional Notes

Having some way to mark a function redefinition as an overload (with strict checking that it does exist in the class defined as inherited from) would probably help solve this issue.

Log File

No response

主要言語
Lua
スター
4.4k
フォーク
442
平均マージ
8日 9時間
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

LuaLS/lua-language-server のほかの issue

LuaLS/lua-language-server の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。