diff --git a/crates/aiken-lang/src/tipo/error.rs b/crates/aiken-lang/src/tipo/error.rs index a7301ca6..edef1333 100644 --- a/crates/aiken-lang/src/tipo/error.rs +++ b/crates/aiken-lang/src/tipo/error.rs @@ -638,7 +638,10 @@ The best thing to do from here is to remove it."#))] #[diagnostic(code("type_mismatch"))] #[diagnostic(help("{}", suggest_unify(expected, given, situation, rigid_type_names)))] CouldNotUnify { - #[label] + #[label( + "expected type '{}'", + expected.to_pretty_with_names(rigid_type_names.clone(), 0), + )] location: Span, expected: Arc, given: Arc, @@ -1152,13 +1155,13 @@ pub enum Warning { name: String, }, - #[error("I came across an unused variable: '{}'.\n", name.purple())] + #[error("I came across an unused variable.\n")] #[diagnostic(help( "No big deal, but you might want to remove it to get rid of that warning." ))] #[diagnostic(code("unused::variable"))] UnusedVariable { - #[label] + #[label("unused")] location: Span, name: String, }, diff --git a/crates/aiken-project/src/error.rs b/crates/aiken-project/src/error.rs index 4ca6c781..988d275a 100644 --- a/crates/aiken-project/src/error.rs +++ b/crates/aiken-project/src/error.rs @@ -480,7 +480,7 @@ impl Diagnostic for Warning { fn help<'a>(&'a self) -> Option> { match self { - Warning::Type { .. } => None, + Warning::Type { warning, .. } => warning.help(), Warning::NoValidators => None, Warning::DependencyAlreadyExists { .. } => Some(Box::new( "If you need to change the version, try 'aiken packages upgrade' instead.",