mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Use store constraint instead of eq
This commit is contained in:
parent
dc67593d80
commit
d3273381f7
2 changed files with 4 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue