New issue

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

Optional pointer to empty struct never evaluates to null #1178

Closed
dbandstra opened this Issue Jun 30, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@dbandstra
Contributor

dbandstra commented Jun 30, 2018

const std = @import("std");

pub const EmptyStruct = struct{};

test "test" {
  var x: ?*EmptyStruct = null;
  std.debug.assert(x == null); // fails
}

Works if the struct is not empty.

Follow up to #1153

@andrewrk andrewrk added this to the 0.3.0 milestone Jun 30, 2018

@andrewrk andrewrk added the bug label Jun 30, 2018

@andrewrk andrewrk closed this in 345f8db Sep 18, 2018

bb010g added a commit to bb010g/oxid that referenced this issue Nov 12, 2018

bb010g added a commit to bb010g/oxid that referenced this issue Nov 12, 2018

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