mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Wrap unification subs in Env
This commit is contained in:
parent
0989b2cb82
commit
c0e976f544
8 changed files with 375 additions and 356 deletions
|
@ -7,7 +7,7 @@ use roc_region::all::{Loc, Region};
|
|||
use roc_solve_problem::{TypeError, UnderivableReason, Unfulfilled};
|
||||
use roc_types::subs::{instantiate_rigids, Content, FlatType, GetSubsSlice, Rank, Subs, Variable};
|
||||
use roc_types::types::{AliasKind, Category, PatternCategory};
|
||||
use roc_unify::unify::MustImplementConstraints;
|
||||
use roc_unify::unify::{Env, MustImplementConstraints};
|
||||
use roc_unify::unify::{MustImplementAbility, Obligated};
|
||||
|
||||
use crate::solve::type_to_var;
|
||||
|
@ -573,10 +573,15 @@ pub fn resolve_ability_specialization(
|
|||
let signature_var = member_def.signature_var();
|
||||
|
||||
instantiate_rigids(subs, signature_var);
|
||||
let (_vars, must_implement_ability, _lambda_sets_to_specialize, _meta) =
|
||||
unify(subs, specialization_var, signature_var, Mode::EQ).expect_success(
|
||||
"If resolving a specialization, the specialization must be known to typecheck.",
|
||||
);
|
||||
let (_vars, must_implement_ability, _lambda_sets_to_specialize, _meta) = unify(
|
||||
&mut Env::new(subs),
|
||||
specialization_var,
|
||||
signature_var,
|
||||
Mode::EQ,
|
||||
)
|
||||
.expect_success(
|
||||
"If resolving a specialization, the specialization must be known to typecheck.",
|
||||
);
|
||||
|
||||
subs.rollback_to(snapshot);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue