diff options
Diffstat (limited to 'test/diagnostics/common.lua')
-rw-r--r-- | test/diagnostics/common.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index b91380b8..a1dbe819 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -2231,3 +2231,40 @@ mt.init = function () obj.x = 1 end ]] + +TEST [[ +---@class A +X = {} + +function <!X.f!>() end + +function <!X.f!>() end +]] + +TEST [[ +---@meta + +---@class A +X = {} + +function X.f() end + +function X.f() end +]] + +TEST [[ +---@class A +X = {} + +if true then + function X.f() end +else + function X.f() end +end +]] + +TESTWITH 'global-in-nil-env' [[ +local function foo(_ENV) + Joe = "human" +end +]] |