diff options
Diffstat (limited to 'test/diagnostics/common.lua')
-rw-r--r-- | test/diagnostics/common.lua | 233 |
1 files changed, 0 insertions, 233 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index 0e7d4436..32c496df 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -1613,236 +1613,3 @@ local function foo(x) end foo(f()) ]] - -TEST [[ ----@diagnostic disable: unused-local -local x = 0 - -<!x!> = true -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@type integer -local x - -<!x!> = true -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@type unknown -local x - -x = nil -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@type unknown -local x - -x = 1 -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@type unknown|nil -local x - -x = 1 -]] - -TEST [[ ----@diagnostic disable: unused-local - -local x = {} - -x = nil -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@type string -local x - -<?x?> = nil -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@type string? -local x - -x = nil -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@type table -local x - -<!x!> = nil -]] - -TEST [[ ----@diagnostic disable: unused-local - -local x - -x = nil -]] - -TEST [[ ----@diagnostic disable: unused-local, undefined-global - ----@type integer -local x - ----@type number -<!x!> = f() -]] - -TEST [[ ----@diagnostic disable: unused-local, undefined-global - ----@type number -local x - ----@type integer -x = f() -]] - -TEST [[ ----@diagnostic disable: unused-local, undefined-global - ----@type number|boolean -local x - ----@type string -<!x!> = f() -]] - -TEST [[ ----@diagnostic disable: unused-local, undefined-global - ----@type number|boolean -local x - ----@type boolean -x = f() -]] - -TEST [[ ----@diagnostic disable: unused-local, undefined-global - ----@type number|boolean -local x - ----@type boolean|string -<!x!> = f() -]] - -TEST [[ ----@diagnostic disable: unused-local, undefined-global - ----@type boolean -local x - -if not x then - return -end - -x = f() -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@type boolean -local x - ----@type integer -local y - -<!x!> = y -]] - -TEST [[ ----@diagnostic disable: unused-local - -local y = true - -local x -x = 1 -x = y -]] - -TEST [[ ----@diagnostic disable: unused-local - -local t = {} - -local x = 0 -x = x + #t -]] - -TEST [[ ----@diagnostic disable: unused-local - -local x = 0 - -x = 1.0 -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@type integer -local x = 0 - -<!x!> = 1.0 -]] - -do return end -TEST [[ ----@diagnostic disable: unused-local - ----@class A ----@field x integer -local t - -<!t.x!> = true -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@class A ----@field x integer -local t - ----@type boolean -local y - -<!t.x!> = y -]] - -TEST [[ ----@diagnostic disable: unused-local - ----@class A ----@field x integer -local t - -t = { - <!x!> = true -} -]] |