-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generics Super Issue #1861
Comments
thanks for putting all these in one place. i found some more edge cases; maybe some of them are listed here already but i'll try to document them more diligently. |
When will it get done? |
Here's another issue with generics that I don't believe has been documented yet? ---@class A
---@field k string
---@generic T: A
---@param p1 T
function f(p1) local m = p1.k end ^^^ here |
This is odd since this use case works but you have to use the parameter capture for the generic to get its type and it also only works with base Lua types and not custom classes |
I wouldn't really consider that to be "working". Passing strings at runtime just to get the LSP to work correctly is awkward. In theory this should be an easy fix, as the concrete type is literally right there and apart of the function's signature. It's not much different than getting/substituting the type of a concrete |
Oh yeah, definitely not "working" per se but very odd that it works with strings and only base Lua types. I would think it would literally be easier to implement the other way code wise |
how to implement like // typescript interface
interface A<T>{
next<K>(callback:(value:T)=>K):A<K>;
}; or not support now |
This "super issue" serves to organize and track all the issues relating to the implementation of generics.
Some of the following issues are likely duplicates, so some may just need to be marked duplicate and linked to other issues.
T<X, Y>
#1000generic
inheritance does not work #1272The text was updated successfully, but these errors were encountered: