Skip to content

Commit

Permalink
fix: clear resolve cache by module (kcl-lang#1394)
Browse files Browse the repository at this point in the history
remove incorrect code

Signed-off-by: he1pa <[email protected]>
  • Loading branch information
He1pa authored Jun 4, 2024
1 parent 47e3013 commit 2d6e7c1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion kclvm/sema/src/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ pub fn resolve_program_with_opts(
cached_scope
.invalidate_pkgs
.insert(kclvm_ast::MAIN_PKG.to_string());
cached_scope.invalidate_main_pkg_modules = None;
}
}
let scope = resolver.check_and_lint(kclvm_ast::MAIN_PKG);
Expand All @@ -204,6 +203,7 @@ pub fn resolve_program_with_opts(
cached_scope
.invalidate_pkgs
.insert(kclvm_ast::MAIN_PKG.to_string());
cached_scope.invalidate_main_pkg_modules = None;
}
}
if opts.type_erasure {
Expand Down
8 changes: 0 additions & 8 deletions kclvm/sema/src/resolver/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,6 @@ impl DependencyGraph {
}
}
}
for module in main_modules {
let result = self.invalidate_module(module)?;
for pkg in result {
invalidated_set.insert(pkg);
}
self.remove_dependency_from_pkg(&module.filename);
self.add_new_module(module);
}
}
Ok(invalidated_set)
}
Expand Down

0 comments on commit 2d6e7c1

Please sign in to comment.