fix weird region in error messages

This commit is contained in:
Folkert 2020-07-21 16:20:03 +02:00
parent b45b39af5e
commit a82cc7f28f
2 changed files with 3 additions and 3 deletions

View File

@ -1019,7 +1019,7 @@ fn constrain_def(env: &Env, def: &Def, body_con: Constraint) -> Constraint {
expr_type,
annotation_expected.clone(),
Category::Storage,
annotation.region,
Region::span_across(&annotation.region, &def.loc_expr.region),
));
// when a def is annotated, and it's body is a closure, treat this

View File

@ -3542,8 +3542,8 @@ mod test_reporting {
Something is off with the body of this definition:
2 { x, y } : { x : Int, y ? Bool }
^^^^^^^^^^^^^^^^^^^^^
2 > { x, y } : { x : Int, y ? Bool }
3 > { x, y } = rec
The body is a value of type: