IIUC, the reason a cast is needed in the code below is that i8 and comptime_int are different types and literal integers have the type comptime_int. Is there any way to avoid needing the @as cast? It feels tedious and likely trips up a lot of beginners.
const std = @import("std");
const expectEqual = std.testing.expectEqual;
test "casting" {
var a: i8 = 0;
// This gives "error: unable to resolve comptime value".
try expectEqual(0, a);
// This works.
try expectEqual(@as(i8, 0), a);
}