fix(visitor): module_dependencies shouldn't self require

This commit is contained in:
Aire-One 2023-07-31 19:02:40 +02:00
parent 6441a6a50b
commit 284b49898c
1 changed files with 6 additions and 0 deletions

View File

@ -53,11 +53,17 @@ end
function Module_Dependencies.visit(node: Node, mod: Node, d: Dag) function Module_Dependencies.visit(node: Node, mod: Node, d: Dag)
local all_types <const> = get_all_types_in_node(node) local all_types <const> = get_all_types_in_node(node)
for _, type_name in ipairs(all_types) do for _, type_name in ipairs(all_types) do
if type_name == mod.name then
goto continue
end
local dependency = d.modules[type_name] or d.modules[utils.lowercase(type_name)] local dependency = d.modules[type_name] or d.modules[utils.lowercase(type_name)]
if dependency then if dependency then
mod.dependencies[dependency.name] = dependency.module_path mod.dependencies[dependency.name] = dependency.module_path
replace_in_node_type(node, dependency.module_path, dependency.name) replace_in_node_type(node, dependency.module_path, dependency.name)
end end
::continue::
end end
end end