diff options
Diffstat (limited to 'test/type_inference')
-rw-r--r-- | test/type_inference/init.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 8607625e..da109bd7 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3601,3 +3601,22 @@ TEST 'string' [[ local <?b?> = '' % 1 ]] + +TEST 'string|integer' [[ +---@type boolean +local bool + +local <?x?> = bool and '' or 0 +]] + +TEST 'string|integer' [[ +local bool + +if X then + bool = true +else + bool = false +end + +local <?x?> = bool and '' or 0 +]] |