@class class declaration annotation¶
Note
EmmyLua use @class to simulate classes in OOP, supporting inheritance and fields
 
- Full format:
--@class MY_TYPE[:PARENT_TYPE] [@comment]
- Target: - local variables
- global variables
 
- Examples: - 1 2 3 4 5 - ---@class Car : Transport @define class Car extends Transport local cls = class() function cls:test() end 
- Descriptions: - Sepcifies variable - clsis class- Car, so we can use- @typeto specify other variables’ types as Car, which can improve completion and other functionality.
See also
