mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Coalesce signatures in function def constraining
This commit is contained in:
parent
ce7648b344
commit
db9b29f0c8
1 changed files with 6 additions and 8 deletions
|
@ -1513,6 +1513,8 @@ fn constrain_function_def(
|
||||||
&mut ftv,
|
&mut ftv,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let signature_index = constraints.push_type(signature.clone());
|
||||||
|
|
||||||
let (arg_types, signature_closure_type, ret_type) = match &signature {
|
let (arg_types, signature_closure_type, ret_type) = match &signature {
|
||||||
Type::Function(arg_types, signature_closure_type, ret_type) => {
|
Type::Function(arg_types, signature_closure_type, ret_type) => {
|
||||||
(arg_types, signature_closure_type, ret_type)
|
(arg_types, signature_closure_type, ret_type)
|
||||||
|
@ -1528,8 +1530,7 @@ fn constrain_function_def(
|
||||||
Loc {
|
Loc {
|
||||||
region: loc_function_def.region,
|
region: loc_function_def.region,
|
||||||
// todo can we use Type::Variable(expr_var) here?
|
// todo can we use Type::Variable(expr_var) here?
|
||||||
// TODO coalesce with other signatures
|
value: signature_index,
|
||||||
value: constraints.push_type(signature.clone()),
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1541,8 +1542,7 @@ fn constrain_function_def(
|
||||||
AnnotationSource::TypedBody {
|
AnnotationSource::TypedBody {
|
||||||
region: annotation.region,
|
region: annotation.region,
|
||||||
},
|
},
|
||||||
// TODO coalesce with other signatures
|
signature_index,
|
||||||
constraints.push_type(signature.clone()),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -1565,8 +1565,7 @@ fn constrain_function_def(
|
||||||
AnnotationSource::TypedBody {
|
AnnotationSource::TypedBody {
|
||||||
region: annotation.region,
|
region: annotation.region,
|
||||||
},
|
},
|
||||||
// TODO coalesce with other signature indeces
|
signature_index,
|
||||||
constraints.push_type(signature.clone()),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let ret_constraint = constrain_untyped_closure(
|
let ret_constraint = constrain_untyped_closure(
|
||||||
|
@ -1653,8 +1652,7 @@ fn constrain_function_def(
|
||||||
AnnotationSource::TypedBody {
|
AnnotationSource::TypedBody {
|
||||||
region: annotation.region,
|
region: annotation.region,
|
||||||
},
|
},
|
||||||
// TODO coalesce with other signature indices
|
signature_index,
|
||||||
constraints.push_type(signature.clone()),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue