Skip to content
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

Open
1 of 15 tasks
carsakiller opened this issue Jan 30, 2023 · 5 comments
Open
1 of 15 tasks

Generics Super Issue #1861

carsakiller opened this issue Jan 30, 2023 · 5 comments
Labels
feat/generic Related to generic emulation feature

Comments

@carsakiller
Copy link
Collaborator

carsakiller commented Jan 30, 2023

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.

@carsakiller carsakiller added the feat/generic Related to generic emulation feature label Jan 30, 2023
@carsakiller carsakiller pinned this issue Jan 30, 2023
@bandaloo
Copy link

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.

@GloopShlugger
Copy link

Is anyone working on this? I would be interested in tackling this

@jakitliang
Copy link

When will it get done?

@tmillr
Copy link

tmillr commented Jan 29, 2024

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 p1 should have a type of A within the function, but it doesn't, so m receives the type unknown

@checkraisefold
Copy link

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 p1 should have a type of A within the function, but it doesn't, so m receives the type unknown

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
see #2355 description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/generic Related to generic emulation feature
Projects
None yet
Development

No branches or pull requests

6 participants