-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Void as a "real" type #20609
Void as a "real" type #20609
Conversation
So, what is a void-typed variable? How is it represented in backend code? |
Should stay as tyVoid until it disappears in cgen |
Does this have any repercussions on |
If I do it right by some miracle, it's just a compiletime construct, so doesn't do anything but let you compare types (or use them in weird ways). Edit: type H = object
x: int
y: void
z: int |
This is covered by nim-lang/RFCs#437 However it says
But fixing it instead is the better solution surely. |
Probably a controversial thing, these all work. Void gets treated as so optional you can skip it entirely proc foo(voidparam: void, intparam: int) = echo intparam
foo(intparam=2)
foo(55)
var x: void
foo(x, 22)
foo(x, intparam=33)
foo(voidparam=x, 44) |
This pull request is stale because it has been open for 1 year with no activity. Contribute more commits on the pull request and rebase it on the latest devel, or it will be closed in 30 days. Thank you for your contributions. |
This pull request has been marked as stale and closed due to inactivity after 395 days. |
Make a bunch of new things possible
Also an alternative to #20385 and #20603