add from annotation cases

This commit is contained in:
Folkert 2020-04-06 22:59:21 +02:00
parent 67f8f2e943
commit 02e42b0abc
3 changed files with 159 additions and 8 deletions

View file

@ -512,7 +512,7 @@ pub fn constrain_expr(
for (index, when_branch) in branches.iter().enumerate() {
let branch_con = constrain_when_branch(
env,
region,
when_branch.value.region,
when_branch,
PExpected::ForReason(
PReason::WhenMatch { index },
@ -522,7 +522,7 @@ pub fn constrain_expr(
FromAnnotation(
name.clone(),
*arity,
TypedWhenBranch(index),
TypedWhenBranch(index + 1),
typ.clone(),
),
);