LuaLS / LuaLS/lua-language-server

[Feature request] generics in overload

Open
#723 7 comments 15 reactions 0 assignees View on GitHub
enhancement feat/generic feat/LuaCats Annotations
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

As far as I know, it is not possible to use `@generic` in `@overload`?

I have a table `Object` that has a `__call` metamethod, so class Object can be used as function: `Object()` == `Object:new()`
... And I want to overload class Object with function `new()`. This function use generics 🤯

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating how @generic and @overload are parsed and represented, then determine the intended syntax and behavior for combining them; done means the supported Object() overload with generics is specified and covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.