diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 2ae79a46..cc3b27e2 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3629,3 +3629,14 @@ local <?b?> TEST 'integer|false' [[ local <?b?> = X == 1 and X == 1 and 1 ]] + +TEST 'unknown|nil' [[ +local function f() + if X then + return ({})[1] + end + return nil +end + +local <?n?> = f() +]] |