add When pattern errors

This commit is contained in:
Folkert 2020-04-07 18:06:00 +02:00
parent 2d1a1621c3
commit 7f999a06f3
7 changed files with 276 additions and 35 deletions

View file

@ -517,7 +517,7 @@ pub fn constrain_expr(
PExpected::ForReason(
PReason::WhenMatch { index },
cond_type.clone(),
region,
Region::across_all(when_branch.patterns.iter().map(|v| &v.region)),
),
FromAnnotation(
name.clone(),
@ -543,7 +543,7 @@ pub fn constrain_expr(
PExpected::ForReason(
PReason::WhenMatch { index },
cond_type.clone(),
region,
Region::across_all(when_branch.patterns.iter().map(|v| &v.region)),
),
ForReason(
Reason::WhenBranch { index },