roc icon indicating copy to clipboard operation
roc copied to clipboard

new compiler: panic: arrays out of sync

Open Anton-4 opened this issue 6 months ago • 2 comments

module []

bool_list = [True, False]
❯ ./zig-out/bin/roc check temp2.roc 
thread 6107 panic: Arrays out of sync:
 type_nodes=83
  region_nodes=80
 
/home/username/gitrepos/roc/src/check/check_types.zig:121:28: 0x11a8458 in processSourceInternal (roc)
            std.debug.panic(
                           ^
/home/username/gitrepos/roc/src/coordinate_simple.zig:112:63: 0x11c0ae7 in processFile (roc)
                var process_result = try processSourceInternal(gpa, returned.source, filepath, config);
                                                              ^
/home/username/gitrepos/roc/src/main.zig:224:55: 0x11c608b in rocCheck (roc)
    var process_result = coordinate_simple.processFile(gpa, Filesystem.default(), args.path, if (cache_manager) |*cm| cm else null, args.time) catch |err| handleProcessFileError(err, stderr, args.path);
                                                      ^
/home/username/gitrepos/roc/src/main.zig:65:40: 0x11d3874 in mainArgs (roc)
        .check => |check_args| rocCheck(gpa, check_args),
                                       ^
...

Anton-4 avatar Jul 14 '25 14:07 Anton-4

Another reproducer:

module []

last = |l|
    match l {
        [] -> Err(ListWasEmpty)
        [.., e] -> Ok(e)
    }

JRI98 avatar Jul 22 '25 19:07 JRI98

Even simpler:

module []

foo = Bool.T

Note: the original example for this issue no longer reproduces. But it does if it is like this:

module []

bool_list = [T, F]

JRI98 avatar Jul 31 '25 14:07 JRI98