We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const std = @import("std"); const Foo = struct { const Self = @This(); pub const Bar = struct { pub fn init() Bar { return Bar { .pending = null, }; } pending: ?*BarList, }; const BarList = std.LinkedList(Bar); expiredList: BarList, pub fn init() Self { return Self{ .expiredList = BarList.init(), }; } pub fn del(self: *Self, to: *Bar) void { if (to.pending) |to_pending| { if ((to_pending != &self.expiredList) && (to_pending.first == null)) { } } } }; test "simple test" { var t = Foo.init(); t.del(&Foo.Bar.init()); }
Fails with:
test.zig:27:51: error: incompatible types: 'bool' and '*bool' if ((to_pending != &self.expiredList) && (to_pending.first == null)) { ^ test.zig:27:29: note: type 'bool' here if ((to_pending != &self.expiredList) && (to_pending.first == null)) { ^ test.zig:27:72: note: type '*bool' here if ((to_pending != &self.expiredList) && (to_pending.first == null)) { ^
The text was updated successfully, but these errors were encountered:
doh. && isn't an operator in zig.
&&
That probably deserves a compiler warning...
Sorry, something went wrong.
and
No branches or pull requests
Fails with:
The text was updated successfully, but these errors were encountered: