diff options
Diffstat (limited to 'test/diagnostics/duplicate-doc-field.lua')
-rw-r--r-- | test/diagnostics/duplicate-doc-field.lua | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/diagnostics/duplicate-doc-field.lua b/test/diagnostics/duplicate-doc-field.lua new file mode 100644 index 00000000..8f385335 --- /dev/null +++ b/test/diagnostics/duplicate-doc-field.lua @@ -0,0 +1,38 @@ +TEST [[ +---@class Class +---@field <!x!> Class +---@field <!x!> Class +]] + +TEST [[ +--- @class Emit +--- @field on fun(eventName: string, cb: function) +--- @field on fun(eventName: '"died"', cb: fun(i: integer)) +--- @field on fun(eventName: '"won"', cb: fun(s: string)) +local emit = {} +]] + +TEST [[ +--- @class Emit +--- @field on fun(eventName: string, cb: function) +--- @field <!on!> fun(eventName: '"died"', cb: fun(i: integer)) +--- @field on fun(eventName: '"won"', cb: fun(s: string)) +--- @field <!on!> fun(eventName: '"died"', cb: fun(i: integer)) +local emit = {} +]] + +TEST [[ +---@class A + +---@class B +---@field [integer] A +---@field [A] true +]] + +TEST [[ +---@class A + +---@class B +---@field [<!A!>] A +---@field [<!A!>] true +]] |