diff --git a/kclvm/sema/src/resolver/import.rs b/kclvm/sema/src/resolver/import.rs index 9844f7f34..e65a85ae0 100644 --- a/kclvm/sema/src/resolver/import.rs +++ b/kclvm/sema/src/resolver/import.rs @@ -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",