-
-
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
fix #19335 Disallow void in type section #20603
Conversation
No, what we should do instead is to map |
Would that actually address the issue with using a field typed as void and is there a good reason to allow typing a field as void in the first place |
In the example it makes no sense but for
|
Yeah that is the case that makes fields disappear, and it continues to work |
Actually this presents the question why void can't be modeled as an empty object instead of a special case type VoidType = object Edit: Rust seems to do it that way and it allows cool stuff like saying |
|
That never worked because as I said it makes the fields disappear completely https://play.nim-lang.org/#ix=4dGQ Edit: Specifically here https://github.com/nim-lang/Nim/blob/devel/compiler/semtypinst.nim#L208 |
Nim had that before Rust, see e.g. |
too bad - makes for a good feature request :) |
Fixes #19335
Edit: Other option would be having the field disappear like with generics but that seems confusing