diff options
-rw-r--r-- | .luarc.json | 10 | ||||
m--------- | 3rd/bee.lua | 0 | ||||
-rw-r--r-- | script/vm/value.lua | 5 | ||||
-rw-r--r-- | test/type_inference/init.lua | 4 |
4 files changed, 13 insertions, 6 deletions
diff --git a/.luarc.json b/.luarc.json index a104c6fc..3121e6b1 100644 --- a/.luarc.json +++ b/.luarc.json @@ -33,11 +33,11 @@ "maxPreload": 1600, "preloadFileSize": 1000, "ignoreDir": [ - "locale/", - "libs/", - "3rd", - ".vscode", - "meta" + "/locale/", + "/libs/", + "/3rd", + "/.vscode", + "/meta" ] } } diff --git a/3rd/bee.lua b/3rd/bee.lua -Subproject a1a96ef5a645f257ce4e4fb3fc5fe6ea730623a +Subproject 8227d0f3cfce7043bbc7af9d18624590f7abd2b diff --git a/script/vm/value.lua b/script/vm/value.lua index 23a9f2c9..bbae446c 100644 --- a/script/vm/value.lua +++ b/script/vm/value.lua @@ -23,10 +23,13 @@ function vm.testCondition(source) hasFalse = true end elseif n.type == 'global' and n.cate == 'type' then + if n.name == 'boolean' then + return nil + end if n.name == 'false' or n.name == 'nil' then hasFalse = true - elseif n.name ~= 'boolean' then + else hasTrue = true end elseif n.type == 'nil' then diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index a8011616..2ae79a46 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3625,3 +3625,7 @@ TEST 'boolean' [[ ---@type boolean|true|false local <?b?> ]] + +TEST 'integer|false' [[ +local <?b?> = X == 1 and X == 1 and 1 +]] |