Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub fn testFn(str: []const u8) u8 {
- return str[0] - 'a';
- }
- pub fn main() !void {
- var str: [4]u8 = undefined;
- str[1] = testFn("abcd") + if (testFn("abcd") > 5) 'a' - 10 else '0';
- }
- ./test.zig:7:59: error: cannot store runtime value in type 'comptime_int'
- str[1] = testFn("abcd") + if (testFn("abcd") > 5) 'a' - 10 else '0';
- ^
- /usr/lib/zig/std/start.zig:334:40: note: referenced here
- const result = root.main() catch |err| {
- ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement