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

allow ?noreturn as a zero-bit type #9396

Closed
lolbinarycat opened this issue Jul 16, 2021 · 1 comment
Closed

allow ?noreturn as a zero-bit type #9396

lolbinarycat opened this issue Jul 16, 2021 · 1 comment

Comments

@lolbinarycat
Copy link

The main usage of this would be for generics. It would allow "disabling" of certain parts of a generic type, for example a generic filesystem that has a Dir parameter could have that set to noreturn to represent a filesystem that did not include opening directories.

It would be a zero bit type because it only has one possible value, null.

Interestingly noreturn already works properly with error unions, with @sizeOf(anyerror) being equal to @sizeOf(anyerror!noreturn).

@zigazeljko
Copy link
Contributor

Duplicate of #3257.

@Vexu Vexu closed this as completed Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants