Replies: 1 comment 1 reply
-
|
Because only inference of the form T... is currently supported, this is not supported yet. ---@generic T
---@param promises [Promise<T>...]
---@return Promise<[T...]>
function Promise.all(promises) end |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I love the type system this project provides. Huge improvement over lua ls.
One thing I couldn't figure out though is how would I go about tuple type transformations.
We can do this:
But is there a way to unwrap those generics so that it becomes
Promise<[integer, string]>instead?We can unwrap a single generic like this
---@alias Awaited<P> P extends Promise<infer T> and T or never, and I tried a bunch of different ways to apply this to a tuple, but nothing seemed to work unfortunately.Is there a way to achieve this or it's not currently possible?
Beta Was this translation helpful? Give feedback.
All reactions