Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Add tres_null_meaning #3

Closed
SuperAuguste opened this issue Dec 24, 2022 · 0 comments
Closed

Add tres_null_meaning #3

SuperAuguste opened this issue Dec 24, 2022 · 0 comments

Comments

@SuperAuguste
Copy link
Member

SuperAuguste commented Dec 24, 2022

pub const A = struct {
    pub const tres_null_meaning = .{.{"a", .field}, .{"b", .null}, .{"c", .dual}};
    a: ?u8 = null,
    b: ?u8 = null,
    c: ??u8 = @as(?u8, null),
};

becomes

{"b": null, "c": null}

Useful for differentiating between abc? fields and abc: ... | null LSP fields.

?? dual fields are non-existent on the first null, then null on the second null. This eliminates the need for Undefinedable which is just super clunky to use.

@SuperAuguste SuperAuguste changed the title Add tres_null_removed_fields Add tres_null_meaning Dec 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant