Perfom derives from global derives module, not just symbol table

This commit is contained in:
Ayaz Hafiz 2022-06-22 16:41:43 -04:00
parent 61db0b6260
commit d8bee6cd18
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
15 changed files with 221 additions and 179 deletions

View file

@ -14,6 +14,7 @@ roc_module = { path = "../module" }
roc_types = { path = "../types" }
roc_can = { path = "../can" }
roc_derive_key = { path = "../derive_key" }
roc_derive = { path = "../derive" }
roc_problem = { path = "../problem" }
roc_unify = { path = "../unify" }
roc_debug_flags = { path = "../debug_flags" }
@ -28,7 +29,7 @@ roc_parse = { path = "../parse" }
roc_solve = { path = "../solve" }
roc_target = { path = "../roc_target" }
roc_reporting = { path = "../../reporting" }
roc_derive_key = { path = "../derive_key", features = ["debug-derived-symbols"] }
roc_derive = { path = "../derive", features = ["debug-derived-symbols"] }
pretty_assertions = "1.0.0"
indoc = "1.0.3"
tempfile = "3.2.0"

View file

@ -61,7 +61,7 @@ pub fn run_solve(
mut aliases: Aliases,
mut abilities_store: AbilitiesStore,
pending_derives: PendingDerives,
derived_symbols: GlobalDerivedSymbols,
derived_module: SharedDerivedModule,
) -> (
Solved<Subs>,
solve::Env,
@ -93,7 +93,7 @@ pub fn run_solve(
&constraint,
pending_derives,
&mut abilities_store,
derived_symbols,
derived_module,
);
(solved_subs, solved_env, problems, abilities_store)

View file

@ -13,7 +13,8 @@ use roc_collections::all::MutMap;
use roc_debug_flags::dbg_do;
#[cfg(debug_assertions)]
use roc_debug_flags::{ROC_TRACE_COMPACTION, ROC_VERIFY_RIGID_LET_GENERALIZED};
use roc_derive_key::{DeriveError, Derived, GlobalDerivedSymbols};
use roc_derive::SharedDerivedModule;
use roc_derive_key::{DeriveError, Derived};
use roc_error_macros::internal_error;
use roc_module::ident::TagName;
use roc_module::symbol::{ModuleId, Symbol};
@ -550,7 +551,7 @@ pub fn run(
constraint: &Constraint,
pending_derives: PendingDerives,
abilities_store: &mut AbilitiesStore,
derived_symbols: GlobalDerivedSymbols,
derived_module: SharedDerivedModule,
) -> (Solved<Subs>, Env) {
let env = run_in_place(
constraints,
@ -560,7 +561,7 @@ pub fn run(
constraint,
pending_derives,
abilities_store,
derived_symbols,
derived_module,
);
(Solved(subs), env)
@ -576,7 +577,7 @@ fn run_in_place(
constraint: &Constraint,
pending_derives: PendingDerives,
abilities_store: &mut AbilitiesStore,
derived_symbols: GlobalDerivedSymbols,
derived_module: SharedDerivedModule,
) -> Env {
let mut pools = Pools::default();
@ -618,7 +619,7 @@ fn run_in_place(
&mut pools,
deferred_uls_to_resolve,
&SolvePhase { abilities_store },
&derived_symbols,
&derived_module,
);
deferred_obligations.add(new_must_implement, AbilityImplError::IncompleteAbility);