-
-
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
Constructing a ref
of a requiresInit
type causes destructions before initialization
#19139
Comments
The issue is that it fails with While the destructors spec allows In Nim, "construction" is the first value to be written into the variable (of which |
You are right, since compiler knows |
There is no bug here, the spec does not mention special cases for |
Since nim-lang/Nim#19139 was closed as a "won't fix", the "workaround" has to become permanent. If we are to store a boolean next to the FD, it would double the structure size, which is undesirable. Instead, storage is now done via a lossless map so that zero-ed values are invalid by default. In this commit, Handle[T] API is changed to match other parts of the project. In short: * `get` -> `fd` * `take` -> `takeFd`
Since nim-lang/Nim#19139 was closed as a "won't fix", the "workaround" has to become permanent. If we are to store a boolean next to the FD, it would double the structure size, which is undesirable. Instead, storage is now done via a lossless map so that zero-ed values are invalid by default. In this commit, Handle[T] API is changed to match other parts of the project. In short: * `get` -> `fd` * `take` -> `takeFd`
handles: change storage strategy and conform API Since nim-lang/Nim#19139 was closed as a "won't fix", the "workaround" has to become permanent. If we are to store a boolean next to the FD, it would double the structure size, which is undesirable. Instead, storage is now done via a lossless map so that zero-ed values are invalid by default. In this commit, Handle[T] API is changed to match other parts of the project. In short: get -> fd take -> takeFd
An another case of #16607
Example
Current Output
Expected Output
no output
Additional Information
nim-sys
.The text was updated successfully, but these errors were encountered: