最萌小汐
最萌小汐
I remember why I didn't support these operators. These operations will be adjusted to Boolean values no matter what type of metamethod you returns. Therefore, it is meaningless to declare...
> Would you accept PRs regarding this or is this subject completely off the table? I'm glad to accept PRs.
My current idea is ```lua ---@class Student ---@exact ---@field study_level integer ``` or ```lua ---@class Student ---@field study_level integer ``` Any other good ideas are also welcome. (Translated by ChatGPT)
> I know it'll break existing code and require work to update the definitions everywhere, but would you consider simply changing the existing so that it enforces exactness by default?...
I can try adding an option that is enabled by default to enable this feature. If many users give feedback that they don't like this feature, I can downgrade it...
I can do this first: ```lua ---@class Class local m = {} m.xx = 1 -- OK ---@type Class local m m.xx = 1 -- OK m.yy = 1 --...
> The downside of this would mean all methods would need to be declared up front. I cannot allow injecting fields from type references; if I did, the cost of...
> For the other case how about: > > ```lua > ---@class Class > local m = {} > > function m:init() > m.xx = true -- OK: adding field...
@carsakiller any suggests for name and syntax of `exact` or `sealed` ?
> Can I ask an example(s) of _typical writing habits_ you wish to support? > > My suggestion works up your suggestion by defining a base table that acts as...