add reporting tests

This commit is contained in:
Sébastien Besnier 2020-11-04 10:51:34 +01:00
parent b2e6ebd32e
commit 619cabe1b8
3 changed files with 31 additions and 3 deletions

View file

@ -1087,7 +1087,7 @@ fn canonicalize_field<'a>(
OptionalValue(label, _, loc_expr) => Err(CanonicalizeFieldProblem::InvalidOptionalValue {
field_name: Lowercase::from(label.value),
field_region: loc_expr.region,
field_region: Region::span_across(&label.region, &loc_expr.region),
}),
// A label with no value, e.g. `{ name }` (this is sugar for { name: name })