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
Yes, but the bottom line is really that --- @class Foo<t>: { a: t } doesn't work because generic classes are not supported. The ---@class Child: Parent syntax is supported elsewhere, so when generic classes are implemented, Child : Parent<T> should also work. This is the first time I have seen this syntax mentioned though, I think, so I'll add it to the list just so we can make sure it receives some attention.
Just trying to keep things organized—there are so many similar issues with slight variations 😄
I see, I thought the generic class was not working when inheriting { a: t } as well. It seems it does though.
--- @classFoo<t>: { a:t; }---@typeFoo<integer>localxprint(x.a) -- Type is integer---@classBar:Foo<integer>---@typeBarlocalyprint(y.a) -- undefined field `a`
Activity
carsakiller commentedon Feb 20, 2023
There are just so many issues about generics and generic classes 😰
Going to close this one as a duplicate of #1863 or #1378
somebody1234 commentedon Feb 20, 2023
@carsakiller saw those from the generics super issue, but afaict this is a different issue
somebody1234 commentedon Feb 20, 2023
the issue here is
: Foo<t>just flat out doesn't workcarsakiller commentedon Feb 20, 2023
Yes, but the bottom line is really that
--- @class Foo<t>: { a: t }doesn't work because generic classes are not supported. The---@class Child: Parentsyntax is supported elsewhere, so when generic classes are implemented,Child : Parent<T>should also work. This is the first time I have seen this syntax mentioned though, I think, so I'll add it to the list just so we can make sure it receives some attention.Just trying to keep things organized—there are so many similar issues with slight variations 😄
somebody1234 commentedon Feb 20, 2023
i was assuming it does work though:
: Foo<t>carsakiller commentedon Feb 20, 2023
I see, I thought the generic class was not working when inheriting
{ a: t }as well. It seems it does though.fix: support generic class inheritance with type arguments