This commit is contained in:
Folkert 2022-03-05 14:55:45 +01:00
parent 97b0e3df9b
commit 48b0bbe874
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -1659,33 +1659,26 @@ fn instantiate_rigids(
} }
// wildcards are always freshly introduced in this annotation // wildcards are always freshly introduced in this annotation
for (i, wildcard) in introduced_vars.wildcards.iter().enumerate() { new_rigids.extend(introduced_vars.wildcards.iter().copied());
ftv.insert(format!("*{}", i).into(), *wildcard);
new_rigids.push(*wildcard); // inferred vars are always freshly introduced in this annotation
} new_rigids.extend(introduced_vars.inferred.iter().copied());
// lambda set vars are always freshly introduced in this annotation // lambda set vars are always freshly introduced in this annotation
for var in introduced_vars.lambda_sets.iter() { new_rigids.extend(introduced_vars.lambda_sets.iter().copied());
new_rigids.push(*var);
}
// lambda set vars are always freshly introduced in this annotation
for var in introduced_vars.inferred.iter() {
new_rigids.push(*var);
}
// Instantiate rigid variables // Instantiate rigid variables
if !rigid_substitution.is_empty() { if !rigid_substitution.is_empty() {
annotation.substitute(&rigid_substitution); annotation.substitute(&rigid_substitution);
} }
if let Some(new_headers) = crate::pattern::headers_from_annotation( let loc_annotation_ref = Loc::at(loc_pattern.region, &annotation);
&loc_pattern.value, if let Pattern::Identifier(symbol) = loc_pattern.value {
&Loc::at(loc_pattern.region, &annotation), headers.insert(symbol, Loc::at(loc_pattern.region, annotation.clone()));
) { } else if let Some(new_headers) =
for (symbol, loc_type) in new_headers { crate::pattern::headers_from_annotation(&loc_pattern.value, &loc_annotation_ref)
headers.insert(symbol, loc_type); {
} headers.extend(new_headers)
} }
annotation annotation