Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Function overloading by declaring multiple functions with same name appears to be completely broken

Đang mở
#3,396 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
lua
Lĩnh vực
devtools

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện vấn đề với đoạn mã Lua tối thiểu trong báo cáo và so sánh với ví dụ @overload đang hoạt động. Truy vết đường đi của quá trình kiểm tra kiểu đối với các khai báo hàm lặp lại và quá trình phân giải overload, sau đó xác minh rằng lời gọi với một đối số vượt qua, trong khi lời gọi với hai đối số vẫn hợp lệ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

MacOS

What is the issue affecting?

Annotations, Type Checking

Expected Behaviour

Given:

---@meta

---@param stringParam string
function DoSomething(stringParam) end

---@param intParam1 integer
---@param intParam2 integer
function DoSomething(intParam1, intParam2) end

DoSomething("test")

I would expect DoSomething("test") to pass typechecking, because it meets the first definition of DoSomething (a single string parameter).

Actual Behaviour

Typechecking fails with "This function requires 2 argument(s) but instead it is receiving 1. (missing-parameter)"

Reproduction steps
  1. Paste the above code into a file
  2. Hover over the last line (DoSomething("test"))
  3. See error
Additional Notes

This issue does not apply to the use of @overload for functions. This passes typechecking:

---@meta

---@param stringParam string
---@overload fun(intParam1: integer, intParam2: integer)
function DoSomething(stringParam) end

DoSomething("test")
Log File

No response

Ngôn ngữ chính
Lua
Star
4.4k
Fork
442
Merge trung bình
8 ngày 9 giờ
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của LuaLS/lua-language-server

Tất cả issue của LuaLS/lua-language-server

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.