Merge pull request #7285 from faldor20/purity-inference-module-params-fixes

Purity inference module params fixes
This commit is contained in:
Eli Dowling 2024-12-01 22:04:30 +10:00 committed by GitHub
commit 21b555d0b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 3 deletions

View file

@ -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())