Coalesce signatures in function def constraining

This commit is contained in:
Ayaz Hafiz 2022-10-25 11:46:19 -05:00
parent ce7648b344
commit db9b29f0c8
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -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()),
); );
{ {