diff --git a/crates/aiken-lang/src/tipo/environment.rs b/crates/aiken-lang/src/tipo/environment.rs index 954ebfdc..afc7da76 100644 --- a/crates/aiken-lang/src/tipo/environment.rs +++ b/crates/aiken-lang/src/tipo/environment.rs @@ -355,33 +355,20 @@ impl<'a> Environment<'a> { fn handle_unused(&mut self, unused: HashMap) { for (name, (kind, location, _)) in unused.into_iter().filter(|(_, (_, _, used))| !used) { let warning = match kind { - EntityKind::ImportedType | EntityKind::ImportedTypeAndConstructor => { - Warning::UnusedType { - name, - imported: true, - location, - } + EntityKind::ImportedType + | EntityKind::ImportedTypeAndConstructor + | EntityKind::ImportedConstructor + | EntityKind::ImportedValue => { + Warning::UnusedImportedValueOrType { name, location } } - EntityKind::ImportedConstructor => Warning::UnusedConstructor { - name, - imported: true, - location, - }, EntityKind::PrivateConstant => { Warning::UnusedPrivateModuleConstant { name, location } } - EntityKind::PrivateTypeConstructor(_) => Warning::UnusedConstructor { - name, - imported: false, - location, - }, + EntityKind::PrivateTypeConstructor(_) => { + Warning::UnusedConstructor { name, location } + } EntityKind::PrivateFunction => Warning::UnusedPrivateFunction { name, location }, - EntityKind::PrivateType => Warning::UnusedType { - name, - imported: false, - location, - }, - EntityKind::ImportedValue => Warning::UnusedImportedValue { name, location }, + EntityKind::PrivateType => Warning::UnusedType { name, location }, EntityKind::Variable => Warning::UnusedVariable { name, location }, }; diff --git a/crates/aiken-lang/src/tipo/error.rs b/crates/aiken-lang/src/tipo/error.rs index 2ce8b768..7a2c9341 100644 --- a/crates/aiken-lang/src/tipo/error.rs +++ b/crates/aiken-lang/src/tipo/error.rs @@ -1437,7 +1437,6 @@ pub enum Warning { UnusedConstructor { #[label] location: Span, - imported: bool, name: String, }, @@ -1463,7 +1462,7 @@ pub enum Warning { "No big deal, but you might want to remove it to get rid of that warning." ))] #[diagnostic(code("unused:import::value"))] - UnusedImportedValue { + UnusedImportedValueOrType { #[label] location: Span, name: String, @@ -1509,7 +1508,6 @@ pub enum Warning { UnusedType { #[label] location: Span, - imported: bool, name: String, },