mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
make it abstract
This commit is contained in:
parent
751ae125a5
commit
9d82f795b7
3 changed files with 7 additions and 5 deletions
|
@ -21,9 +21,7 @@ pub fn run_solve(
|
|||
constraint: Constraint,
|
||||
var_store: VarStore,
|
||||
) -> (Solved<Subs>, solve::Env, Vec<solve::TypeError>) {
|
||||
let env = solve::Env {
|
||||
vars_by_symbol: MutMap::default(),
|
||||
};
|
||||
let env = solve::Env::default();
|
||||
|
||||
let mut subs = Subs::new_from_varstore(var_store);
|
||||
|
||||
|
|
|
@ -78,10 +78,14 @@ pub enum TypeError {
|
|||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct Env {
|
||||
pub vars_by_symbol: MutMap<Symbol, Variable>,
|
||||
vars_by_symbol: MutMap<Symbol, Variable>,
|
||||
}
|
||||
|
||||
impl Env {
|
||||
pub fn vars_by_symbol(&self) -> MutMap<Symbol, Variable> {
|
||||
self.vars_by_symbol.clone()
|
||||
}
|
||||
|
||||
fn get_var_by_symbol(&self, symbol: &Symbol) -> Option<Variable> {
|
||||
self.vars_by_symbol.get(symbol).copied()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue