Skip to content

Commit 43664f8

Browse files
committed
add missing span on error
1 parent cc1bcd1 commit 43664f8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

trilogy/src/trilogy/builder/report.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@ impl<E: std::error::Error> Error<E> {
453453
.with_label(Label::new(dot).with_color(primary).with_message("try removing this `.`"))
454454
.with_help("the spread operator uses only two (`..`)")
455455
}
456-
ErrorKind::IfExpressionRestriction => ariadne::Report::build(kind, span)
456+
ErrorKind::IfExpressionRestriction => ariadne::Report::build(kind, span.clone())
457+
.with_label(Label::new(span).with_color(primary).with_message("in this expression"))
457458
.with_message("an `if` expression must have an `else` clause"),
458459
ErrorKind::TaggedTemplateMissingIdentifier => ariadne::Report::build(kind, span.clone())
459460
.with_message("a tagged template requires a tag identifier")

0 commit comments

Comments
 (0)