You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to write a function that accepts a number of Wrapped<T>'s and returns T's, but couldn't get it to work.
---@classWrapper<T>---@genericT---@param ... Wrapper<T>...---@returnT...functionunwrap(...) end---@typeWrapper<int>, Wrapper<string>locala, b--should be int, stringlocalb, c=unwrap(a, b)
Instead a warning is thrown: expected 0 parameters but found 2 [redundant-parameter].
Can something like this be done with current variadics implementation?
changed the title [-]Combning Classes with Generic Parameters and Variadics[/-][+]Combining Classes with Generic Parameters and Variadics[/+]on Oct 2, 2025
I am currently implementing generic type inference similar to TypeScript, and I have already implemented 'infer'. I believe that type inference will be achievable by then. #786
I am currently implementing generic type inference similar to TypeScript, and I have already implemented 'infer'. I believe that type inference will be achievable by then. #786
That's amazing! Thank you for your efforts. Lua with a type system as powerful as TS's sounds like a dream.
Activity
[-]Combning Classes with Generic Parameters and Variadics[/-][+]Combining Classes with Generic Parameters and Variadics[/+][-]Combining Classes with Generic Parameters and Variadics[/-][+]Combining generic classes and variadics[/+]CppCXY commentedon Oct 3, 2025
This form is not supported yet; it is probably related to issue #714.
xuhuanzy commentedon Oct 3, 2025
I am currently implementing generic type inference similar to TypeScript, and I have already implemented 'infer'. I believe that type inference will be achievable by then.
#786
xuhuanzy commentedon Oct 3, 2025
The corresponding code in TypeScript
Polanas commentedon Oct 3, 2025
That's amazing! Thank you for your efforts. Lua with a type system as powerful as TS's sounds like a dream.
refactor generic: Variable arguments should be inferred as tuples.
xuhuanzy commentedon Oct 5, 2025
Provides generic type inference implementation

refactor generic: Variable arguments should be inferred as tuples.