You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extend void handling to also allow array[..., void].
Description
In #23419 (comment), it is noted that an array of void is not allowed - this unnecessarily burdens generic code since array of void gracefully can be handled the same way as an ordinary void type.
Since void has no data, it follows naturally that array of void also doesn't have any data. We allow void variables, so we should also allow array-of-void variables - they are useful to simplify generic code and can be used as compile-time information carriers for macros, dsl etc.
Alternatives
No response
Examples
No response
Backwards Compatibility
No response
Links
No response
The text was updated successfully, but these errors were encountered:
tuple[] serves a similar purpose but it doesn't get erased in the backend and it doesn't have a special meaning like void that makes it independent from the type system. Some discussion on changing void is on nim-lang/RFCs#508 and #20609.
Summary
Extend
void
handling to also allowarray[..., void]
.Description
In #23419 (comment), it is noted that an array of
void
is not allowed - this unnecessarily burdens generic code since array ofvoid
gracefully can be handled the same way as an ordinaryvoid
type.Since
void
has no data, it follows naturally that array of void also doesn't have any data. We allow void variables, so we should also allow array-of-void variables - they are useful to simplify generic code and can be used as compile-time information carriers for macros, dsl etc.Alternatives
No response
Examples
No response
Backwards Compatibility
No response
Links
No response
The text was updated successfully, but these errors were encountered: