mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-25 15:33:47 +00:00
Merge pull request #7285 from faldor20/purity-inference-module-params-fixes
Purity inference module params fixes
This commit is contained in:
commit
21b555d0b2
4 changed files with 31 additions and 3 deletions
|
@ -2269,18 +2269,18 @@ fn update<'a>(
|
|||
state.fx_mode = FxMode::PurityInference;
|
||||
}
|
||||
}
|
||||
Builtin { .. } | Module { .. } => {
|
||||
Builtin { .. } => {
|
||||
if header.is_root_module {
|
||||
debug_assert!(matches!(state.platform_path, PlatformPath::NotSpecified));
|
||||
state.platform_path = PlatformPath::RootIsModule;
|
||||
}
|
||||
}
|
||||
Hosted { exposes, .. } => {
|
||||
Hosted { exposes, .. } | Module { exposes, .. } => {
|
||||
if header.is_root_module {
|
||||
debug_assert!(matches!(state.platform_path, PlatformPath::NotSpecified));
|
||||
state.platform_path = PlatformPath::RootIsHosted;
|
||||
}
|
||||
|
||||
// WARNING: This will be bypassed if we export a record of effectful functions. This is a temporary hacky method
|
||||
if exposes
|
||||
.iter()
|
||||
.any(|exposed| exposed.value.is_effectful_fn())
|
||||
|
|
|
@ -3345,6 +3345,17 @@ fn unify_flat_type<M: MetaCollector>(
|
|||
|
||||
outcome
|
||||
}
|
||||
(Func(args, closure, ret, fx), EffectfulFunc) => {
|
||||
let mut outcome = unify_pool(env, pool, *fx, Variable::EFFECTFUL, ctx.mode);
|
||||
|
||||
outcome.union(merge(
|
||||
env,
|
||||
ctx,
|
||||
Structure(Func(*args, *closure, *ret, Variable::EFFECTFUL)),
|
||||
));
|
||||
|
||||
outcome
|
||||
}
|
||||
(FunctionOrTagUnion(tag_names, tag_symbols, ext), Func(args, closure, ret, fx)) => {
|
||||
unify_function_or_tag_union_and_func(
|
||||
env,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue