Coalesce signatures in destructure constraining

This commit is contained in:
Ayaz Hafiz 2022-10-25 11:56:08 -05:00
parent b8b0d4f028
commit 6c4722fe1c
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58

View File

@ -1826,14 +1826,15 @@ fn constrain_destructure_def(
resolutions_to_make: vec![],
};
let signature_index = constraints.push_type(signature);
let annotation_expected = FromAnnotation(
loc_pattern.clone(),
arity,
AnnotationSource::TypedBody {
region: annotation.region,
},
// TODO coalesce with other signatures
constraints.push_type(signature.clone()),
signature_index,
);
// This will fill in inference variables in the `signature` as well, so that we can
@ -1847,8 +1848,6 @@ fn constrain_destructure_def(
annotation_expected,
);
let signature_index = constraints.push_type(signature);
let cons = [
ret_constraint,
// Store type into AST vars. We use Store so errors aren't reported twice