mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-14 13:49:08 +00:00
Fix Bool index in Bool.roc
This commit is contained in:
parent
5916742443
commit
fe215a452d
2 changed files with 8 additions and 3 deletions
|
@ -46,14 +46,13 @@ pub fn main() !void {
|
|||
const set_roc_source = try std.fs.cwd().readFileAlloc(gpa, "src/build/roc/Set.roc", 1024 * 1024);
|
||||
defer gpa.free(set_roc_source);
|
||||
|
||||
// Compile Bool.roc without injecting Bool (it defines Bool itself)
|
||||
// We still inject Result since Bool.roc might use it
|
||||
// Compile Bool.roc without injecting anything (it's completely self-contained)
|
||||
const bool_env = try compileModule(
|
||||
gpa,
|
||||
"Bool",
|
||||
bool_roc_source,
|
||||
&.{}, // No module dependencies
|
||||
.{ .inject_bool = false, .inject_result = true },
|
||||
.{ .inject_bool = false, .inject_result = false },
|
||||
);
|
||||
defer {
|
||||
bool_env.deinit();
|
||||
|
|
|
@ -171,8 +171,14 @@ pub fn deinit(
|
|||
self.scratch_free_vars.deinit(gpa);
|
||||
}
|
||||
|
||||
/// Options for initializing the canonicalizer.
|
||||
/// Controls which built-in types are injected into the module's scope.
|
||||
pub const InitOptions = struct {
|
||||
/// Whether to inject the Bool type declaration (`Bool := [True, False]`).
|
||||
/// Set to false when compiling Bool.roc itself to avoid duplication.
|
||||
inject_bool: bool = true,
|
||||
/// Whether to inject the Result type declaration (`Result(ok, err) := [Ok(ok), Err(err)]`).
|
||||
/// Set to false when compiling Result.roc itself (if it exists).
|
||||
inject_result: bool = true,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue