Skip to content

Commit

Permalink
de: Error earlier for comptime field deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ibokuri committed Oct 19, 2023
1 parent ff3ec6e commit 1687959
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/de/impls/visitor/struct.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ pub fn Visitor(comptime Struct: type) type {
var found = false;

inline for (fields, 0..) |field, i| {
if (field.is_comptime) {
@compileError("TODO: DESERIALIZATION OF COMPTIME FIELD");
}

const attrs = comptime attrs: {
if (attributes) |attrs| {
if (@hasField(@TypeOf(attrs), field.name)) {
Expand Down Expand Up @@ -94,10 +98,6 @@ pub fn Visitor(comptime Struct: type) type {
};

if (name_cmp or aliases_cmp) {
if (field.is_comptime) {
@compileError("TODO: DESERIALIZATION OF COMPTIME FIELD");
}

// If field has already been deserialized, return an
// error.
if (seen[i]) {
Expand Down

0 comments on commit 1687959

Please sign in to comment.