diff options
Diffstat (limited to 'test/diagnostics')
-rw-r--r-- | test/diagnostics/cast-local-type.lua | 5 | ||||
-rw-r--r-- | test/diagnostics/param-type-mismatch.lua | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/test/diagnostics/cast-local-type.lua b/test/diagnostics/cast-local-type.lua index 93452a92..d702adf3 100644 --- a/test/diagnostics/cast-local-type.lua +++ b/test/diagnostics/cast-local-type.lua @@ -1,3 +1,4 @@ +local config = require "config.config" TEST [[ local x = 0 @@ -345,6 +346,8 @@ local v v = a ]] +config.set(nil, 'Lua.type.checkTableShape', true) + TEST [[ ---@class A ---@field x string @@ -398,3 +401,5 @@ local a = {x = "b", y = {}} local v <!v!> = a ]] + +config.set(nil, 'Lua.type.checkTableShape', false) diff --git a/test/diagnostics/param-type-mismatch.lua b/test/diagnostics/param-type-mismatch.lua index bb602cab..b75e9307 100644 --- a/test/diagnostics/param-type-mismatch.lua +++ b/test/diagnostics/param-type-mismatch.lua @@ -1,3 +1,4 @@ +local config = require "config.config" TEST [[ ---@param x number local function f(x) end @@ -278,6 +279,8 @@ function f(a) end f(a) ]] +config.set(nil, 'Lua.type.checkTableShape', true) + TEST [[ ---@class A ---@field x string @@ -347,4 +350,6 @@ local a = {} function f(a) end f(a) -]]
\ No newline at end of file +]] + +config.set(nil, 'Lua.type.checkTableShape', false) |