This commit is contained in:
Folkert 2020-09-06 18:53:26 +02:00
parent ceb938c9af
commit 46755973d6
8 changed files with 59 additions and 13 deletions

View file

@ -268,11 +268,15 @@ fn constrain_pattern(
loc_expr.region,
);
state.constraints.push(Constraint::Eq(
Type::Variable(*expr_var),
expr_expected.clone(),
Category::DefaultValue(label.clone()),
state.constraints.push(Constraint::Pattern(
region,
PatternCategory::PatternDefault,
Type::Variable(*expr_var),
PExpected::ForReason(
PReason::OptionalField,
pat_type.clone(),
loc_expr.region,
),
));
state.vars.push(*expr_var);