tamer: asg::error: Clarify DanglingExpr

DEV-13597
main
Mike Gerwitz 2023-01-20 09:32:01 -05:00
parent 50afb2d359
commit b87c078894
1 changed files with 8 additions and 2 deletions

View File

@ -94,7 +94,10 @@ impl Display for AsgError {
IdentRedefine(spair, _) => {
write!(f, "cannot redefine {}", TtQuote::wrap(spair))
}
DanglingExpr(_) => write!(f, "dangling expression"),
DanglingExpr(_) => write!(
f,
"dangling expression (anonymous expression has no parent)"
),
UnbalancedExpr(_) => write!(f, "unbalanced expression"),
InvalidExprBindContext(_) => {
write!(f, "invalid expression identifier binding context")
@ -153,7 +156,10 @@ impl Diagnostic for AsgError {
],
DanglingExpr(span) => vec![
span.error("expression has no parent or identifier"),
span.error(
"this expression is unreachable and its value \
cannot be used",
),
span.help("an expression must either be the child of another "),
span.help(
" expression or be assigned an identifier, otherwise ",