fix(visitors): prevent circular dependencies
ci/woodpecker/pr/docker-build Pipeline was successful Details
ci/woodpecker/pr/lint Pipeline was successful Details
ci/woodpecker/pr/test Pipeline was successful Details
ci/woodpecker/pr/build-and-run Pipeline failed Details

This commit is contained in:
Aire-One 2023-10-07 00:25:16 +02:00
parent ebd33b0a19
commit a2d172d31d
1 changed files with 3 additions and 1 deletions

View File

@ -59,7 +59,9 @@ function Module_Dependencies.visit(node: Node, mod: Node, d: Dag)
local dependency = d.modules[type_name] or d.modules[utils.lowercase(type_name)]
if dependency then
mod.dependencies[dependency.name] = dependency.module_path
if dependency.name ~= mod.name then
mod.dependencies[dependency.name] = dependency.module_path
end
replace_in_node_type(node, dependency.module_path, dependency.name)
end