Improve the error message if alias type inference fails (#2399)

* Improve the error message if alias type inference fails

* Improve error further
This commit is contained in:
Jonathan Turner 2020-08-25 06:38:24 +12:00 committed by GitHub
parent d859bff877
commit f078aacc25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,10 +189,12 @@ fn check_insert(
Some(shape) => match shape { Some(shape) => match shape {
SyntaxShape::Any => Ok(()), SyntaxShape::Any => Ok(()),
shape if shape == new => Ok(()), shape if shape == new => Ok(()),
_ => Err(ShellError::labeled_error( _ => Err(ShellError::labeled_error_with_secondary(
"Type conflict in alias variable use", "Type conflict in alias variable use",
"creates type conflict", format!("{:?}", new),
(to_add.1).0, (to_add.1).0,
format!("{:?}", shape),
exist.0,
)), )),
}, },
}, },