mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Load main
in the CLI and use it for gen
This commit is contained in:
parent
9ca754b8fd
commit
1517581ced
6 changed files with 84 additions and 424 deletions
|
@ -55,6 +55,7 @@ pub struct LoadedModule {
|
|||
pub can_problems: Vec<roc_problem::can::Problem>,
|
||||
pub type_problems: Vec<solve::TypeError>,
|
||||
pub declarations: Vec<Declaration>,
|
||||
pub exposed_vars_by_symbol: Vec<(Symbol, Variable)>,
|
||||
pub src: Box<str>,
|
||||
}
|
||||
|
||||
|
@ -96,6 +97,7 @@ enum Msg {
|
|||
solved_types: MutMap<Symbol, SolvedType>,
|
||||
aliases: MutMap<Symbol, Alias>,
|
||||
subs: Arc<Solved<Subs>>,
|
||||
exposed_vars_by_symbol: Vec<(Symbol, Variable)>,
|
||||
problems: Vec<solve::TypeError>,
|
||||
},
|
||||
}
|
||||
|
@ -395,6 +397,7 @@ pub async fn load<'a>(
|
|||
solved_types,
|
||||
subs,
|
||||
problems,
|
||||
exposed_vars_by_symbol,
|
||||
aliases,
|
||||
src,
|
||||
} => {
|
||||
|
@ -431,6 +434,7 @@ pub async fn load<'a>(
|
|||
can_problems,
|
||||
type_problems,
|
||||
declarations,
|
||||
exposed_vars_by_symbol,
|
||||
src,
|
||||
});
|
||||
} else {
|
||||
|
@ -928,10 +932,10 @@ fn solve_module(
|
|||
// 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 {
|
||||
let solved_type = SolvedType::new(&solved_subs, var);
|
||||
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.insert(*symbol, solved_type);
|
||||
}
|
||||
|
||||
tokio::spawn(async move {
|
||||
|
@ -942,6 +946,7 @@ fn solve_module(
|
|||
src,
|
||||
module_id: home,
|
||||
subs: Arc::new(solved_subs),
|
||||
exposed_vars_by_symbol,
|
||||
solved_types,
|
||||
problems,
|
||||
aliases: env.aliases,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue