Skip to content

Conversation

@jules-sommer
Copy link

The following breaking change was merged in this Zig PR: ziglang/zig#21225 which means that on newer Zig versions all references to std.builtin.Type have to be updated to correctly reflect that, an example:

// new format matching naming conventions:
const type_info = @typeInfo(T);
const fields = type_info.@"struct".fields;

// previous to PR#21225
const type_info = @typeInfo(T);
const fields = type_info.Struct.fields;

I am on Zig version: v0.14.0-dev.2270+a5d4ad17b but older versions will also run into compiler errors. Not sure exactly where that PR ended up in relation to semver. Either way, I ran into it and the change was easy enough I figured I'd quickly submit this PR.

test
└─ run test
   └─ zig test Debug native 7 errors
src/float.zig:35:23: error: no field named 'Float' in union 'builtin.Type'
    switch (type_info.Float.bits) {
                      ^~~~~

tests are passing on my machine, but if anything is wrong or needs changing feel free to reply/edit. 😄

~ Jules

@lalinsky
Copy link
Owner

Thank you for this, I'll create a branch for zig 0.13 and then merge it.

@lalinsky lalinsky merged commit 3a2978f into lalinsky:main Dec 12, 2024
1 check failed
@jules-sommer
Copy link
Author

Thank you for this, I'll create a branch for zig 0.13 and then merge it.

of course! glad it was helpful. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants