summaryrefslogtreecommitdiff
path: root/test/diagnostics/duplicate-doc-field.lua
blob: 8f385335952fdd2c834485e5302f07c176513bdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
]]