Skip to content
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
ghost opened this issue Jun 30, 2018 · 0 comments
Closed

Optional pointer to empty struct never evaluates to null #1178

ghost opened this issue Jun 30, 2018 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@ghost
Copy link

ghost 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 Observed behavior contradicts documented or intended behavior label Jun 30, 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
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

1 participant