Use store constraint instead of eq

This commit is contained in:
Ayaz Hafiz 2023-07-24 21:02:56 -05:00
parent dc67593d80
commit d3273381f7
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 4 additions and 10 deletions

View file

@ -2479,20 +2479,14 @@ fn add_host_annotation(
constraint: Constraint,
) -> Constraint {
if let Some((var, ann)) = host_exposed_annotation {
let expected_bool = {
let host_annotation = {
let type_index = types.from_old_type(&ann.signature);
let ann_type = constraints.push_type(types, type_index);
constraints.push_expected_type(Expected::ForReason(
Reason::ExpectCondition,
ann_type,
Region::zero(),
))
constraints.push_type(types, type_index)
};
let new =
constraints.equal_types_var(*var, expected_bool, Category::Unknown, Region::zero());
let store_constr = constraints.store(host_annotation, *var, file!(), line!());
constraints.and_constraint([new, constraint])
constraints.and_constraint([store_constr, constraint])
} else {
constraint
}