The following code works well in a regular program in the test/fx/ directory for example, but when evaluating with the interpreter tests in src/eval/test/low_level_interp_test.zig , it fails.
test "e_low_level_lambda - U8.plus basic" {
const src =
\\a : U8
\\a = 5
\\b : U8
\\b = 3
\\x : U8
\\x = U8.plus(a, b)
;
const value = try evalModuleAndGetInt(src, 2);
try testing.expectEqual(@as(i128, 8), value);
}
I’ve tried a few variations of this example, and the TypeMismatch is the one that comes back most of the time.
❯ zig build test
test
└─ tests_summary
└─ run test eval 537/538 passed, 1 failed
error: 'test.low_level_interp_test.test.e_low_level_lambda - U8.plus basic' failed: /Users/piz/git/roc-lang/roc/src/eval/interpreter.zig:2199:21: 0x1020745af in evalExprMinimal (eval)
return error.TypeMismatch;
^
/Users/piz/git/roc-lang/roc/src/eval/interpreter.zig:357:16: 0x102034387 in evalMinimal (eval)
return try self.evalExprMinimal(expr_idx, roc_ops, null);
^
/Users/piz/git/roc-lang/roc/src/eval/test/low_level_interp_test.zig:138:29: 0x10243c637 in evalModuleAndGetInt (eval)
const stack_value = try result.evaluator.interpreter.evalMinimal(def.expr, ops);
^
/Users/piz/git/roc-lang/roc/src/eval/test/low_level_interp_test.zig:1135:19: 0x10244145f in test.e_low_level_lambda - U8.plus basic (eval)
const value = try evalModuleAndGetInt(src, 2);
^
error: while executing test 'test.list_refcount_builtins.test.list refcount builtins - phase 12 limitation documented', the following test command failed:
./.zig-cache/o/043f7b958e657d15765bf3cb0f00af62/eval --cache-dir=./.zig-cache --seed=0x9302518d --listen=-
Build Summary: 54/57 steps succeeded; 1 failed; 1616/1617 tests passed; 1 failed
test transitive failure
└─ tests_summary transitive failure
└─ run test eval 537/538 passed, 1 failed
error: the following build command failed with exit code 1:
.zig-cache/o/60d699020c5a472d82aa95da80b88525/build /opt/homebrew/Cellar/zig/0.15.2/bin/zig /opt/homebrew/Cellar/zig/0.15.2/lib/zig /Users/piz/git/roc-lang/roc .zig-cache /Users/piz/.cache/zig --seed 0x9302518d -Zcb2427e166fa2426 test
And using a.plus(b) instead of U8.plus(a,b) get us a panic.
Last updated: Nov 28 2025 at 12:16 UTC