mirror of
https://github.com/nushell/nushell.git
synced 2024-11-30 04:14:17 +01:00
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:
parent
d859bff877
commit
f078aacc25
@ -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,
|
||||||
)),
|
)),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user