I am trying to do something like this, is this possible. (The reason is that I am returning errors while tokenizing, but I need to catch these errors and attach line numbers)
error_info.zig:
line: usize = 0,
column: usize = 0,
type: error{ErrorType} = .unknown,
test "test error type" {
const e = self{
.line = 1,
.column = 2,
.type = .unexpected_eof,
};
expect(e.line == 1);
}
This wont compile:
error_info.zig:41:27: error: expected type 'error{ErrorType}', found '@TypeOf(.enum_literal)'
type: error{ErrorType} = .unknown,```