Fix types SoA usage in solve

This commit is contained in:
Ayaz Hafiz 2022-11-09 09:11:56 -06:00
parent 6b5f632364
commit a2e90c3709
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
6 changed files with 30 additions and 16 deletions

View file

@ -27,6 +27,7 @@ use roc_reporting::report::{type_problem, RocDocAllocator};
use roc_types::{
pretty_print::{name_and_print_var, DebugPrint},
subs::{ExposedTypesStorageSubs, Subs, Variable},
types::Types,
};
const DERIVED_MODULE: ModuleId = ModuleId::DERIVED_SYNTH;
@ -343,11 +344,12 @@ fn check_derived_typechecks_and_golden(
check_golden: impl Fn(&str),
) {
// constrain the derived
let mut types = Types::new();
let mut constraints = Constraints::new();
let def_var = derived_def.expr_var;
let mut decls = Declarations::new();
decls.push_def(derived_def);
let constr = constrain_decls(&mut constraints, test_module, &decls);
let constr = constrain_decls(&mut types, &mut constraints, test_module, &decls);
// the derived implementation on stuff from the builtin module, so
// - we need to add those dependencies as imported on the constraint
@ -394,7 +396,7 @@ fn check_derived_typechecks_and_golden(
);
let (mut solved_subs, _, problems, _) = roc_solve::module::run_solve(
test_module,
Default::default(),
types,
&constraints,
constr,
RigidVariables::default(),