Skip to content

Commit

Permalink
fix: make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zong-zhe committed Sep 21, 2023
1 parent a59d706 commit e5db9b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kclvm/sema/src/resolver/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ impl<'ctx> Resolver<'ctx> {
match self.ctx.import_names.get_mut(&self.ctx.filename) {
Some(mapping) => {
// 'import sub as s' and 'import sub.sub as s' will raise this error.
// 'import sub' and 'import sub' will not raise this error.
if mapping.get(&import_stmt.name).is_some() && import_stmt.asname.is_some() {
// 'import sub' and 'import sub' will not raise this error.
if mapping.get(&import_stmt.name).is_some()
&& import_stmt.asname.is_some()
{
self.handler.add_compile_error(
&format!(
"the name '{}' is defined multiple times, '{}' must be defined only once",
Expand Down

0 comments on commit e5db9b1

Please sign in to comment.