iter 23.1.2: load_workspace auto-injects prelude module

This commit is contained in:
2026-05-10 21:13:40 +02:00
parent cce3d9738e
commit 3742583924
3 changed files with 85 additions and 2 deletions
+13
View File
@@ -1140,6 +1140,19 @@ fn workspace_error_to_diagnostic(
"type": type_repr,
})),
),
// Iter 23.1: the user named a module `prelude`, which the
// loader reserves for the auto-injected prelude module.
W::ReservedModuleName { name } => Some(
ailang_check::Diagnostic::error(
"reserved-module-name",
format!(
"module name {name:?} is reserved (auto-injected by the loader)"
),
)
.with_ctx(serde_json::json!({
"module": name,
})),
),
}
}