Merge pull request #2754 from rtfeldman/remove-type-solvedtype-conversion

Remove Type/Subs -> SolvedType conversion
This commit is contained in:
Richard Feldman 2022-03-19 10:48:42 -04:00 committed by GitHub
commit 5f2054aeb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 439 deletions

View file

@ -3,7 +3,7 @@ use roc_can::constraint::{Constraint as ConstraintSoa, Constraints};
use roc_can::module::RigidVariables;
use roc_collections::all::MutMap;
use roc_module::symbol::Symbol;
use roc_types::solved_types::{Solved, SolvedType};
use roc_types::solved_types::Solved;
use roc_types::subs::{StorageSubs, Subs, Variable};
use roc_types::types::Alias;
@ -60,26 +60,6 @@ pub fn run_solve(
(solved_subs, solved_env, problems)
}
pub fn make_solved_types(
solved_subs: &Solved<Subs>,
exposed_vars_by_symbol: &[(Symbol, Variable)],
) -> MutMap<Symbol, SolvedType> {
let mut solved_types = MutMap::default();
// exposed_vars_by_symbol contains the Variables for all the Symbols
// this module exposes. We want to convert those into flat SolvedType
// annotations which are decoupled from our Subs, because that's how
// other modules will generate constraints for imported values
// within the context of their own Subs.
for (symbol, var) in exposed_vars_by_symbol.iter() {
let solved_type = SolvedType::new(solved_subs, *var);
solved_types.insert(*symbol, solved_type);
}
solved_types
}
pub fn exposed_types_storage_subs(
solved_subs: &mut Solved<Subs>,
exposed_vars_by_symbol: &[(Symbol, Variable)],