Sobeston / zig.guide

Repo for https://zig.guide content. Get up to speed with Zig quickly.
https://zig.guide
MIT License
689 stars 177 forks source link

No member named 'signedness' in struct 'std.builtin.Int' #95

Closed jtanza closed 3 years ago

jtanza commented 3 years ago

Ran into an issue when creating a custom Int type from @typeInfo in the GetBiggerInt func within the Comptime section of Chapter 1:

./hello.zig:312:43: error: no member named 'signedness' in struct 'std.builtin.Int'
            .signedness = @typeInfo(T).Int.signedness,

Updating .signedness to .is_signed fixes the issue for me.

I am happy to open up a PR to update .signedness =>.is_signed in that struct if that is actually an error and I am not just missing something (still a zig noob here).

Zig Version/ OS Info:

jtanza :: projects/zig/hello » zig version                                                                                  
0.7.1
jtanza :: projects/zig/hello » uname -a
Linux jtanza 5.8.7-arch1-1 Sat, 05 Sep 2020 12:31:32 +0000 x86_64 GNU/Linux
Sobeston commented 3 years ago

Zig changed it from is_signed to signedness somewhere between 0.7.1 and now; this guide only supports the master build of Zig

jtanza commented 3 years ago

Ah, my fault now seeing: "This guide assumes you’re using a master build of Zig as opposed to the latest major release..." in the guide.

Sorry about that!