Skip to content

fix(loop): replace catch unreachable with try in self_hosting_loop.zig init #159

@gHashTag

Description

@gHashTag

Task

In src/tri/self_hosting_loop.zig lines 199-200, ArrayList initialization uses catch unreachable:

.target_files = std.ArrayList([]const u8).initCapacity(allocator, 0) catch unreachable,
.patch_history = std.ArrayList(SelfPatch).initCapacity(allocator, 0) catch unreachable,

Allocation can fail. Use try instead.

Fix

.target_files = try std.ArrayList([]const u8).initCapacity(allocator, 0),
.patch_history = try std.ArrayList(SelfPatch).initCapacity(allocator, 0),

Ensure the enclosing function returns an error union if needed.

File

  • src/tri/self_hosting_loop.zig — lines 199-200

Acceptance

  • zig build compiles without errors
  • zig fmt passes
  • No catch unreachable on ArrayList init

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:spawnAuto-spawn agent container

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions