Handle multi pattern unbound list rest variables

This commit is contained in:
JRI98 2024-06-21 17:01:49 +01:00
parent 03eadc2e0f
commit f4551978ce
No known key found for this signature in database
GPG key ID: F83B29916FF13F24
4 changed files with 35 additions and 5 deletions

View file

@ -141,7 +141,7 @@ fn headers_from_annotation_help(
constraints.push_type(types, typ)
};
let typ = Loc::at(annotation.region, annotation_index);
headers.insert(rest, typ);
headers.insert(rest.value, typ);
false
} else {
@ -735,7 +735,7 @@ pub fn constrain_pattern(
if let Some((_, Some(rest))) = opt_rest {
state.headers.insert(
*rest,
rest.value,
Loc {
region,
value: *constraints[expected].get_type_ref(),