Hello, I am having trouble understanding this compile error (next post). Could anyone help me please?
Link to repo with current changes: https://github.com/birth-software/nativity/tree/hello-world
1 messages · Page 1 of 1 (latest)
Hello, I am having trouble understanding this compile error (next post). Could anyone help me please?
Link to repo with current changes: https://github.com/birth-software/nativity/tree/hello-world
zig build-exe nativity Debug native: error: the following command failed with 1 compilation errors:
/home/david/dev/zig/build-release/stage3/bin/zig build-exe -freference-trace=256 -fllvm -fno-lld /home/david/dev/nativity/src/main.zig --cache-dir /home/david/dev/nativity/zig-cache --global-cache-dir /home/david/.cache/zig --name nativity --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run nativity transitive failure
└─ zig build-exe nativity Debug native 1 errors
/home/david/dev/zig/lib/std/enums.zig:729:29: error: parameter of type 'enums.EnumFieldStruct(backend.x86_64.Instruction.Operand.Id,type,null)' must be declared comptime
pub fn init(init_values: EnumFieldStruct(E, V, @as(?V, null))) Self {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/david/dev/zig/lib/std/enums.zig:24:12: note: struct requires comptime because of this field (9 times)
return @Type(.{ .Struct = .{
^~~~~
/home/david/dev/zig/lib/std/enums.zig:24:12: note: types are not available at runtime (9 times)
return @Type(.{ .Struct = .{
^~~~~
/home/david/dev/zig/lib/std/enums.zig:24:12: note: struct declared here
return @Type(.{ .Struct = .{
^~~~~
referenced by:
operand_type_map: src/backend/x86_64.zig:1064:65
new: src/backend/x86_64.zig:1076:50
selectInstructions: src/backend/x86_64.zig:1407:80
initialize: src/backend/emit.zig:120:46
compileModule: src/Compilation.zig:949:49
main: src/main.zig:16:20
callMain: /home/david/dev/zig/lib/std/start.zig:583:32
initEventLoopAndCallMain: /home/david/dev/zig/lib/std/start.zig:517:34
callMainWithArgs: /home/david/dev/zig/lib/std/start.zig:467:12
posixCallMainAndExit: /home/david/dev/zig/lib/std/start.zig:423:39
_start: /home/david/dev/zig/lib/std/start.zig:336:40