From f078aacc25dfb9741f0c747f5e3a040cf58373cf Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Tue, 25 Aug 2020 06:38:24 +1200 Subject: [PATCH] Improve the error message if alias type inference fails (#2399) * Improve the error message if alias type inference fails * Improve error further --- crates/nu-cli/src/commands/alias.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/nu-cli/src/commands/alias.rs b/crates/nu-cli/src/commands/alias.rs index a12b2c98d9..089d8e57b7 100644 --- a/crates/nu-cli/src/commands/alias.rs +++ b/crates/nu-cli/src/commands/alias.rs @@ -189,10 +189,12 @@ fn check_insert( Some(shape) => match shape { SyntaxShape::Any => Ok(()), shape if shape == new => Ok(()), - _ => Err(ShellError::labeled_error( + _ => Err(ShellError::labeled_error_with_secondary( "Type conflict in alias variable use", - "creates type conflict", + format!("{:?}", new), (to_add.1).0, + format!("{:?}", shape), + exist.0, )), }, },