Closed ghost closed 2 years ago
---@class t
---@field value number
local t = {}
MakeProperty(t, "value")
print(t.value)
Yea but if I change the Property(false, ... is showing as number and not boolean. I searching for something to inherit de generic T from 'Property(value, get)' to 'get fun(this: property { value: T }): T' or something
Generics aren't as strong for the time being, and you can write comments
---@param this SpecialClass
local value = property(10, function (this)
end)
---@generic T
---@param value T
---@return { value: T }
function test(value)
return { value = value }
end
local a2 = test(1);
a2.value [[is type T]]
Would be nice to have.
Is possible to make it work?