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
Hello, I apologize for bringing yet another generics issue as I know it takes time for it to be made solid... Thanks for looking into my problem. I use the following code to extend the number[] class, but then the elements are not marked as numbers for a non literal object.
---@classNumberTable:number[]---@paramtNumberTable---@returnnumber|nilfunctionFirstElement(t)
localn=t[1] -- marked as unknownreturnnend---@paramtnumber[]---@returnnumber|nilfunctionFirstElementBis(t)
localn=t[1] -- marked as numberreturnnend
I would expect t[1] to be marked as number. I also tried replacing number[] with table<number> and table<number, number> without success. Thank you!
Activity
tomlau10 commentedon Sep 25, 2025
The workaround for now is using the Typed Field feature
https://luals.github.io/wiki/annotations/#field