-
-
Notifications
You must be signed in to change notification settings - Fork 376
Closed
@Cooldude2606
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Type Checking
Expected Behaviour
It is expected that the return value (callback
) is resolved to Callback<string>
which is expanded to fun(): Success, string
where Success is fun(): Success
(returns itself) without causing a stack overflow.
Actual Behaviour
A stack overflow occurs and the return value has an unknown type.
Reproduction steps
- Copy the following code into a lua file.
--- @alias Success fun(): Success --- @alias Callback<T> fun(): Success, T --- @return Success local function success() return success end --- @generic T --- @param callback Callback<T> --- @return Callback<T> local function make_callback(callback) return callback end local callback = make_callback(function() return success, "" end)
- No special vscode settings or luarc file is required.
- Upon workspace reload or diagonistics, a stack overflow immediately occurs. Visible via view->output->Lua
Additional Notes
This is an abstract minimum reproduction of the issue. My full use case has multiple self returning functions used to indicate different statuses, and the make_callback
function would be a method on a class instance to which the callbacks are registered to.
Log File
Metadata
Metadata
Assignees
Labels
No labels