diff options
-rw-r--r-- | script/vm/compiler.lua | 3 | ||||
-rw-r--r-- | test/diagnostics/common.lua | 4 | ||||
-rw-r--r-- | test/type_inference/init.lua | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index c8dfaf9a..c83262ab 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -13,7 +13,6 @@ local vm = require 'vm.vm' ---@class parser.object ---@field _compiledNodes boolean ---@field _node vm.node ----@field _localBase table ---@field _globalBase table local searchFieldSwitch = util.switch() @@ -933,7 +932,7 @@ local compilerSwitch = util.switch() local runner = vm.createRunner(source) runner:launch(function (src, node) if src.type == 'setlocal' then - if src.value and not hasMark then + if src.value then if src.value.type == 'table' then vm.setNode(src, src.value) else diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index f52a9b20..b8d3d18a 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -888,8 +888,8 @@ local v ---@type Bar local v2 v2 = v -- TODO 这里应该给警告 -v2:<!method1!>() -v2:method2() +v2:method1() +v2:<!method2!>() ]] TEST [[ diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 9eb469de..2616898d 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -1238,14 +1238,14 @@ TEST '👍' [[ local <?x?> ]] -TEST 'boolean' [[ +TEST 'integer' [[ ---@type boolean local x <?x?> = 1 ]] -TEST 'Class' [[ +TEST 'integer' [[ ---@class Class local x |