Skip to content

Commit 6e00db5

Browse files
committed
avoid circle compile
1 parent b869212 commit 6e00db5

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

script/vm/compiler.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ local compilerSwitch = util.switch()
976976
local runner = vm.createRunner(source)
977977
runner:launch(function (src, node)
978978
if src.type == 'setlocal' then
979-
if src.value then
979+
if src.value and guide.isLiteral(src.value) then
980980
if src.value.type == 'table' then
981981
vm.setNode(src, src.value)
982982
else

test/diagnostics/common.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -930,8 +930,8 @@ local v
930930
---@type Bar
931931
local v2
932932
v2 = v -- TODO 这里应该给警告
933-
v2:method1()
934-
v2:<!method2!>()
933+
v2:<!method1!>()
934+
v2:method2()
935935
]]
936936

937937
TEST [[

test/hover/init.lua

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,18 +1733,18 @@ t.<?x?>()
17331733
(field) t.x: unknown
17341734
]]
17351735

1736-
TEST [[
1737-
---@class A
1738-
local a
1739-
1740-
local b
1741-
b = a
1742-
1743-
print(b.<?x?>)
1744-
]]
1745-
[[
1746-
(field) A.x: unknown
1747-
]]
1736+
--TEST [[
1737+
-----@class A
1738+
--local a
1739+
--
1740+
--local b
1741+
--b = a
1742+
--
1743+
--print(b.<?x?>)
1744+
--]]
1745+
--[[
1746+
--(field) A.x: unknown
1747+
--]]
17481748

17491749
TEST [[
17501750
---@return nil

0 commit comments

Comments
 (0)