mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
Simplify opportunistic resolution
We don't need to unify the type state anymore because resolved able variables are determined only by one type variable.
This commit is contained in:
parent
403b2b14b7
commit
350d9cd59b
1 changed files with 2 additions and 17 deletions
|
@ -1476,13 +1476,10 @@ fn solve(
|
||||||
|
|
||||||
state
|
state
|
||||||
}
|
}
|
||||||
// TODO: turning off opportunistic specialization for now because it doesn't mesh well with
|
|
||||||
// the polymorphic lambda resolution algorithm. After
|
|
||||||
// https://github.com/rtfeldman/roc/issues/3207 is resolved, this may be redundant
|
|
||||||
// anyway.
|
|
||||||
&Resolve(OpportunisticResolve {
|
&Resolve(OpportunisticResolve {
|
||||||
specialization_variable,
|
specialization_variable,
|
||||||
specialization_expectation,
|
// TODO: remove me
|
||||||
|
specialization_expectation: _,
|
||||||
member,
|
member,
|
||||||
specialization_id,
|
specialization_id,
|
||||||
}) => {
|
}) => {
|
||||||
|
@ -1495,18 +1492,6 @@ fn solve(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
abilities_store.insert_resolved(specialization_id, specialization);
|
abilities_store.insert_resolved(specialization_id, specialization);
|
||||||
|
|
||||||
// We must now refine the current type state to account for this specialization.
|
|
||||||
let lookup_constr = arena.alloc(Constraint::Lookup(
|
|
||||||
specialization,
|
|
||||||
specialization_expectation,
|
|
||||||
Region::zero(),
|
|
||||||
));
|
|
||||||
stack.push(Work::Constraint {
|
|
||||||
env,
|
|
||||||
rank,
|
|
||||||
constraint: lookup_constr,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
state
|
state
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue