mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Coalesce even more annotation types
This commit is contained in:
parent
a6889a4f6d
commit
e0a2139b1e
1 changed files with 1 additions and 5 deletions
|
@ -2657,11 +2657,9 @@ fn constrain_typed_function_arguments_simple(
|
|||
let it = arguments.iter().zip(arg_types.iter()).enumerate();
|
||||
for (index, ((pattern_var, annotated_mark, loc_pattern), ann)) in it {
|
||||
let pattern_var_index = constraints.push_type(Variable(*pattern_var));
|
||||
let ann_index = constraints.push_type(ann.clone());
|
||||
|
||||
if loc_pattern.value.surely_exhaustive() {
|
||||
// TODO coalesce
|
||||
let ann_index = constraints.push_type(ann.clone());
|
||||
|
||||
// OPT: we don't need to perform any type-level exhaustiveness checking.
|
||||
// Check instead only that the pattern unifies with the annotation type.
|
||||
let pattern_expected = PExpected::ForReason(
|
||||
|
@ -2687,7 +2685,6 @@ fn constrain_typed_function_arguments_simple(
|
|||
// this constraint must be to the def_pattern_state's constraints
|
||||
def_pattern_state.vars.push(*pattern_var);
|
||||
|
||||
let ann_index = constraints.push_type(ann.clone());
|
||||
let ann_expected =
|
||||
constraints.push_expected_type(Expected::NoExpectation(ann_index));
|
||||
let pattern_con = constraints.equal_types_var(
|
||||
|
@ -2725,7 +2722,6 @@ fn constrain_typed_function_arguments_simple(
|
|||
|
||||
{
|
||||
// Store the actual type in a variable.
|
||||
let ann_index = constraints.push_type(ann.clone());
|
||||
let expected_annotation =
|
||||
constraints.push_expected_type(Expected::NoExpectation(ann_index));
|
||||
argument_pattern_state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue